PolyFuseQL: A Unified Middleware for Polyglot Persistence Using the Strategy Design Pattern and Apache Spark Federation
Modern applications rely on diverse database types to store information efficiently, but interacting with these systems requires developers to master multiple specialized query languages. This fragments development, as engineers must write complex custom code for each database just to retrieve routine data. While existing big-data tools offer a unified query language, they force all data requests through heavy processing engines, degrading the fast performance required for everyday tasks. To address this problem, we introduce PolyFuseQL, a smart routing layer acting as a universal SQL translator for five popular databases (PostgreSQL, Redis, Neo4j, MongoDB, and Cassandra). Our objective is to allow developers to communicate transparently with diverse systems using standard SQL, completely avoiding the need to write specific NoSQL logic. Methodologically, PolyFuseQL dynamically evaluates standard SQL queries to determine the optimal execution path. It translates and sends simple requests directly to the native databases to ensure high speed while seamlessly routing complex analytical queries to a powerful Apache Spark engine. We evaluated the system’s performance across varying workloads. Results indicate that PolyFuseQL adds almost no delay to simple queries, preserving sub-millisecond response times. Concurrently, it enables users to execute complex operations, such as eight-table joins, on NoSQL databases that lack native relational support. Although a fixed processing delay during initial data translation slightly limits absolute hardware scaling, the system scales reliably for medium-sized analytical tasks. Ultimately, PolyFuseQL provides a unified, easy-to-use SQL interface to diverse NoSQL databases without sacrificing operational speed.
Authors
- Diana Martínez-Mosquera (ORCID: https://orcid.org/0000-0002-0573-8640)
- Iván Carrera (ORCID: https://orcid.org/0000-0003-4337-7433)
- Andres Andrade-Cabrera (ORCID: https://orcid.org/0009-0002-5080-9126)
Institutions
- National Polytechnic School (EC)
Publication Details
- Journal
- Applied Sciences
- Published
- 2026-08-27
- DOI
- https://doi.org/10.3390/app16178512
- Primary Topic
- Advanced Database Systems and Queries
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Escuela Politécnica Nacional