Many actual nosql systems are schemaless, that is, the structure of the data is not defined beforehand in any schema, but it is implicit in the data itself. This characteristic is very convenient when the data structu...
详细信息
Many actual nosql systems are schemaless, that is, the structure of the data is not defined beforehand in any schema, but it is implicit in the data itself. This characteristic is very convenient when the data structure suffers frequent changes. However, the agility and flexibility achieved is at the cost of losing some important benefits, such as 1) assuring that the data stored and retrieved fits the database schema;2) some database utilities require to know the schema, and;3) schema visualization helps developers to write better code. In previous work, we proposed a model-based reverse engineering approach to infer schema models from nosqldata. Model-driven engineering (MDE) techniques can be used to take advantage of extracted models with different purposes, such as schema visualization or automatic code generation. Here, in this paper, we present an MDE solution to automate the usage of Object-nosql mappers when the database already exists. We will focus on mappers that are available for document systems (Object-Document mappers, ODMs), but the proposed approach is mapper-independent. These mappers are emerging to provide similar functionality to Object-Relational mappers: they are in charge of the mapping of objects into nosqldata (documents in the case of ODMs) for object-oriented applications. We show how schemas and other artifacts (e.g. validators and indexes) for ODMs can be automatically generated from inferred schemas. The solution consists of a two-step model transformation chain, where an intermediate model is generated to ease the code generation. We have applied our approach for two popular ODMs: Mongoose and Morphia and validated it with the StackOverflow dataset.
Most nosql systems are schemaless. This lack of schema offers a greater flexibility than relational systems. However, this comes at the cost of losing benefits such as the static checking that assure that stored data ...
详细信息
ISBN:
(纸本)9789897582103
Most nosql systems are schemaless. This lack of schema offers a greater flexibility than relational systems. However, this comes at the cost of losing benefits such as the static checking that assure that stored data conforms to the database schema. Instead, developers must be in charge of this task that is time-consuming and error-prone. Object-nosql mappers are emerging to alleviate this task and facilitate the development of nosql applications. These mappers allow the definition of schemas, which are used to assure that data are correctly manipulated. In this article, we present an MDE approach that automatically generates schemas and other artefacts for mappers. As proof of concept, we have considered Mongoose, which is a widely used mapper for MongoDB, but the solution is mapper-independent. Firstly, the schemas are inferred from stored data by using an approach defined in a previous work. Then, nosql schema models are input to a two-step model transformation chain that generates schemas, validators and updating procedures, among other Mongoose artefacts. An intermediate metamodel has been defined to ease the implementation of the transformations. This work shows how MDE techniques can be applied in the emerging "nosql data engineering" field.
暂无评论