Mogwaï: A framework to handle complex queries on large models

Gwendal Daniel, Gerson Sunyé, Jordi Cabot

TL;DR

This paper introduces Mogwaï, a framework that translates Object Constraint Language (OCL) queries into Gremlin, a graph traversal language, to efficiently query large models stored in NoSQL databases. By executing queries directly within the database, Mogwaï bypasses the limitations of traditional modeling framework APIs, achieving significant speedups and memory reductions.

What Problem Does This Paper Address?

The increasing adoption of Model Driven Engineering (MDE) has led to the management of increasingly large models. While NoSQL databases offer a scalable solution for storing these models, existing MDE frameworks, particularly those built on the Eclipse Modeling Framework (EMF), struggle to leverage this scalability. Their APIs, designed for smaller models, create performance bottlenecks when querying large datasets. Specifically, the XMI serialization format and the reliance on low-level APIs for querying result in significant time and memory overhead due to the need to reify intermediate objects. This paper addresses the gap between scalable NoSQL storage and the inefficient querying mechanisms in current MDE tools.

Methods

Mogwaï tackles this problem by implementing a model-to-model transformation. It takes OCL queries, which are parsed into an OCL model, and transforms them into Gremlin traversals. This transformation process maps OCL expressions to corresponding Gremlin steps, leveraging Gremlin's ability to directly interact with NoSQL databases. The key innovation is that the generated Gremlin traversals are executed inside the NoSQL database, rather than being processed by the MDE framework's API. This allows Mogwaï to take advantage of database-specific optimizations, indexes, and caching mechanisms. The framework also defines its own Gremlin metamodel to represent the generated traversals.

Datasets

The paper evaluates Mogwaï using two large models automatically generated by the MoDisco Java Discoverer tool. These models are derived from Eclipse Java plug-ins: org.eclipse.gmt.modisco.java and org.eclipse.jdt.core. The models represent different sizes, with the larger one containing over 1.5 million elements. The queries used for evaluation are taken from typical MoDisco software modernization use cases.

Key Insights and Ideas

  • Bridging the Gap: Mogwaï effectively bridges the gap between scalable NoSQL backends and the querying needs of MDE frameworks by translating high-level OCL queries into a database-native language (Gremlin).
  • Database-Native Execution: The core idea is to push query execution down to the database. This is crucial because traditional MDE APIs are not designed to exploit the performance benefits of NoSQL databases.
  • Avoiding Intermediate Object Reification: A major performance bottleneck in existing approaches is the creation and management of intermediate objects in memory. Mogwaï's direct translation and database execution bypass this, leading to significant memory savings.
  • Gremlin as a Unifying Language: The choice of Gremlin is strategic, as it's a mature and generic query language for various NoSQL databases, making Mogwaï adaptable to different storage backends.

Key Results

Mogwaï demonstrates significant performance improvements over existing frameworks (EMF-Query, Eclipse OCL interpreter) when querying large models stored in NoSQL databases. Specifically, the experiments show:

  • Execution Time: Up to a 20x improvement in execution time for complex queries on large models.
  • Memory Consumption: Up to a 75x reduction in memory overhead for large models.

These improvements are most pronounced for queries that involve a large number of intermediate objects or benefit from database indexes. For simpler queries that traverse small subsets of the model, the benefits are less dramatic but still present.

Limitations and Future Work

  • Integration Overhead: The paper acknowledges that integrating Mogwaï into an existing EMF environment requires explicit instruction for other Eclipse plug-ins to use it, which is a manual step.
  • Transformation Engine Overhead: For very small models or simple queries, the overhead of the transformation engine itself might negate the benefits.
  • Future Work: The authors plan to:
  • Study the definition of custom Gremlin steps to enhance expressiveness.
  • Optimize collection operations for more readable traversals.
  • Explore the integration of imperative constructs into their OCL support for complex update operations.
  • Investigate the impact of semantically-equivalent OCL expressions on generated traversals and explore automatic refactoring.
  • Adapt the model-to-model transformation approach to work with SQL databases.

Summary updated

Abstract

While Model Driven Engineering is gaining more industrial interest, scalability issues when managing large models have become a major problem in current modeling frameworks. Scalable model persistence has been achieved by using NoSQL backends for model storage, but existing modeling framework APIs have not evolved accordingly, limiting NoSQL query performance benefits. In this paper we present the Mogwaï, a scalable and efficient model query framework based on a direct translation of OCL queries to Gremlin, a query language supported by several NoSQL databases. Generated Gremlin expressions are computed inside the database itself, bypassing limitations of existing framework APIs and improving overall performance, as confirmed by our experimental results showing an improvement of execution time up to a factor of 20 and a reduction of the memory overhead up to a factor of 75 for large models.
BibTeX
@inproceedings{daniel2016mogwai,
  author = {Gwendal Daniel and Gerson Sunyé and Jordi Cabot},
  title = {{Mogwaï: A framework to handle complex queries on large models}},
  booktitle = {RCIS},
  year = {2016},
  url = {https://openreview.net/forum?id=GN2e4EPt6m},
}

Loading related content...

Figure