Implementing a Classic ER Algebra to Automatically Generate Complex Queries for Document-Oriented Databases

  • Viviana Noguera UFSCar
  • Daniel Lucrédio UFSCar

Resumo


NoSQL databases are designed to fulfill performance and scalability requirements, normally by allowing data to be stored without a fixed schema. For this reason, it is not rare that new usage and performance requirements appear during a system's life cycle, demanding changes to be made in the schema, challenging the developer with extra adaptation effort to update data access code (database queries). The literature presents some solutions to reduce this effort by making queries independent from the schema, but the solutions are normally restricted to simple queries or a predefined mapping. In this paper, we present evidence showing that a classic ER algebra and a Model Management approach can be used to implement a solution that works with complex queries in any schema. The algebra defines operations that can be used by developers to specify complex queries in terms of Entities and Relationships. We created a language for this algebra, with a concrete syntax and a generative operational semantics targeting a document-oriented database. As in Model Management, the generative semantics is guided by the mapping information between Entities, Relationships, and Documents, and is able to generate, for a single ER-based input query, native query code for different schemas, all producing the same results in terms of data structure. Test results show that our implementation is consistent with the algebra's definition, producing evidence that this approach can lead to schema independence in complex NoSQL queries.
Palavras-chave: Code generation, Complex queries, Entity Relationship algebra, Model Management, NoSQL databases
Publicado
23/09/2019
NOGUERA, Viviana; LUCRÉDIO, Daniel. Implementing a Classic ER Algebra to Automatically Generate Complex Queries for Document-Oriented Databases. In: SIMPÓSIO BRASILEIRO DE COMPONENTES, ARQUITETURAS E REUTILIZAÇÃO DE SOFTWARE (SBCARS), 13. , 2019, Salvador/BA. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2019 . p. 43–52.