<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Scalable Model Versioning, Querying &amp; Persistence</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Innsbruck, Department of Computer Science</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>The discipline of model engineering has matured considerably over the last years and is applied in a wide array of domains, ranging from embedded software development to IT landscape documentation. A variety of di erent model repositories attempt to meet the requirements that emerge when working on models, most notably e cient persistence, versioning and query capabilities. However, existing tools scale poorly when faced with large models used in practice, in particular in scenarios where (semi-)automated element generation pushes model sizes to hundred thousand individual elements and beyond. In this paper, we present our research agenda for Chronos1, an e ort which aims to provide a solution to this problem in the form of a novel model repository for EMF Ecore models.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        In recent years, the importance and popularity of model engineering has
increased considerably, both in academic as well as in industrial
settings [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Models are being created in a variety of languages and
frameworks, with EMF Ecore [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] and UML [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] as the most prominent
examples. As models grow larger and get more sophisticated, the demand for
tools that support collaboration on model editing also increases. Such
tools are often referred to as model repositories. Their core features
encompass storing, versioning and querying model data. Pierantonio et al.
have recently assembled and published a list of existing model
repositories [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. The list contains open-source pojects like Eclipse Common
Data Objects (CDO)2 and EMFStore3 as well as commercial systems
such as MagicDraw Teamwork Server4. In our experience, none of these
tools scales well with models of large sizes, most notably due to
performance issues and/or lack of features (e.g. versioning capabilities and
expressiveness of queries). An important factor for scalability is the
employed persistence technology, and all aforementioned model repositories
use one of two technologies:
1 This work was partially funded by the research project \QE LaB - Living Models
for Open Systems" (FFG 822740) and \txtureSA" (FWF-Project P 29022).
2 https://eclipse.org/cdo/
3 http://www.eclipse.org/emfstore/
4 http://www.nomagic.com/products/teamwork-server.html
{ File / XML-Based
      </p>
      <p>
        Model repositories in this category store serialized forms of models
in les (typically XML, or XMI [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] in the case of Ecore). For
versioning, this implies the existence of one le per version. EMFStore and
      </p>
      <p>MagicDraw Teamwork server are representatives of this category.
{ Relational / SQL-Based</p>
      <p>Tools based on relational technology aim to perform a mapping from
the object representation into an equivalent relational
representation. This process is referred to as object-relational mapping, or
O/R-mapping. The relational information is then stored in a
traditional database system. Versioning introduces additional entries
in the relational tables to store the state of an element at a given
version. Eclipse CDO makes use of this approach.</p>
      <p>Both techniques su er from severe drawbacks and are not optimal for
storage of model data. XML-based systems struggle with per-element
versioning and the absence of indexing structures for querying, as well
as having di culties in providing lazy loading capabilities, because any
given XML le must usually be processed in its entirety before
individual elements can be extracted. Such processing (i.e. serialization or
deserialization) is also very costly with respect to CPU power, RAM
and runtime. Relational backends (e.g. SQL databases) provide indexing
structures and per-element loading while also working on a user-de ned
schema which allows for versioning, provided that the repository takes
care of this aspect on its own. The major problem with relational
backends is the expensive Object{Relational Mapping (O/R mapping)
process that converts objects into table entries and vice versa. O/R mapping
increases considerably in complexity when objects with many
connections to other objects have to be processed, which is a very common
use case for modeling. Typical O/R mapping algorithms are often
implemented in a recursive fashion5 which can lead to call stack over ows on
su ciently large models. Converting the relational representation back
into model element objects requires at least one SQL JOIN operation
per connection. These operations have inherent quadratic complexity and
therefore scale poorly.</p>
      <p>We aim to improve the situation by adressing the hot spots of resource
consumption: object (de-)serialization, storage of versioned data and
queries on the persisted information. We do so by applying concepts from
the NoSQL area and combining them with suitable mapping strategies
and a novel approach to storage of versioned data.</p>
      <p>The remainder of this document is structured as follows. Section 2
provides an overview of the related work. In Section 3 we present an outline
of our solution. We present the expected contributions of the thesis in
Section 4 and outline a plan for evaluation and validation of our approach
in Section 5. Finally, Section 6 provides details on the current state of
the project and Section 7 concludes the paper with a summary.
5 As for example in Hibernate: http://hibernate.org/</p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        Having realized the shortcomings of the existing storage solutions for
large models as described in Section 1, Gomez et al. proposed and
implemented alternatives for EMF based on NoSQL technology, using graphs [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
and later also using key-value stores [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Their results clearly demonstrate
that storing model data in a graph or key-value format is not only
feasible, but also performs a lot better than traditional relational storage
mechanisms.
      </p>
      <p>
        In 2014, Felber et al. proposed a set of algorithms that enable versioning
on a key-value store [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. However, the work of Felber focuses exclusively
on versioning of non-connected data, while Gomez considered
graphbased storage without versioning aspects. The idea of graph-based model
persistence in a versioned key-value store backend forms the foundation
of our own work.
      </p>
      <p>
        As the resulting artifact of this PhD thesis is going to be a model
repository, all the tools listed by Pierantonio et al. [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] are considered as related
work. There are two major conceptual di erences between our solution
and existing repositories. The rst di erence is the level of abstraction
in the technology. All relevant existing tools are either built on top of a
pre-existing database or le format. We are going to develop and provide
the entire data management stack, from the le format to the database
and transaction management to model querying. The second di erence
is that our approach takes the latest advances in NoSQL research into
account, which opens many possibilities, in particular with respect to
model queries and performance.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Proposed Solution</title>
      <p>We propose a model repository that is capable of handling tightly
coupled, large-scale models with 100000 individual elements and beyond.
The features will include a rich query API and full per-element versioning
support, as well as important collaboration features such as lightweight
branching and con ict detection.</p>
      <p>s
o
n
o
r
h
C</p>
      <sec id="sec-3-1">
        <title>Application</title>
      </sec>
      <sec id="sec-3-2">
        <title>ChronoSphere</title>
      </sec>
      <sec id="sec-3-3">
        <title>ChronoGraph</title>
      </sec>
      <sec id="sec-3-4">
        <title>ChronoDB</title>
        <p>EMF
Ecore</p>
        <p>Fig. 1. The Chronos Data Management Stack
This project is named Chronos, and consists of three main parts
(collectively called Chronos Components). These components build on top of
each other:
{ ChronoDB is the storage backend, and the lowest layer in the
Chronos project. It is a key-value store with built-in versioning
capabilities, to which we refer to as a Temporal Key-Value Store.
ChronoDB is intended primarily as a lightweight storage backend for
embedding into an application that writes to the local hard drive. In the
repository, it is responsible for storage, versioning and branching. We
implement these features on the lowest level because the key-value
format is conceptually simple compared to an object graph, which
reduces the complexity of the versioning problem.
{ ChronoGraph is an implementation of the Apache Tinkerpop6
graph computing API, mapping graph structures onto the key-value
schema provided by ChronoDB. Several other libraries, including
Titan DB7, have demonstrated that it is possible and feasible to
implement a graph database based on a key-value store. ChronoGraph
provides the low-level query API and a standardized storage format
to the repository.
{ ChronoSphere is an EMF Ecore model repository. Built on top
of ChronoGraph, it maps incoming model data onto a
standardized graph structure. By leveraging the capabilities of the TinkerPop
graph query language Gremlin, it will provide expressive model-level
queries to programmers, as well as the versioning and branching
features provided by ChronoDB.</p>
        <p>In combination, these three components form a new type of model
repository that implements the full data management stack. Aside from this
top-level goal, due to the modular design, these three components can
also be used individually in other projects: ChronoDB is a
generalpurpose key-value store with versioning support, and ChronoGraph
implements the Apache TinkerPop API, the de-facto standard API for
graph databases, enabling it to act as drop-in replacement for other
implementations.
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Expected Contributions</title>
      <p>The thesis will provide the following contributions to the theory of
temporal data stores and model repositories:
4.1</p>
      <sec id="sec-4-1">
        <title>Contributions to Theory</title>
        <p>A formal model for a Temporal Key-Value Store: This
formalization is based on an in nite two-dimensional matrix structure that de nes
and exclusively relies on history{preserving append{only operations. It
provides the formal semantics which guide the implementation of the
6 http://tinkerpop.incubator.apache.org/
7 http://thinkaurelius.github.io/titan/</p>
        <p>
          A novel query framework: By utilizing the features o ered by the
NoSQL graph database, ChronoSphere will provide an entirely new
approach to model queries. It will allow developers to write queries at model
level in an internal, Java-embedded domain-speci c language that can
be checked by the compiler, providing additional compile-time
recognition of e.g. type system errors or spelling mistakes in comparison to
string-based alternatives, such as OCL [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ] which can only be checked at
run-time. This language makes use of index structures that are updated
automatically when the model is changed. These indices are aware of the
versioning aspects, allowing equally fast queries on any version of the
model. Lazy evaluation will be the default mode of operation, enabling
the execution of queries without prior need for full resolution of a model
version.
4.2
        </p>
      </sec>
      <sec id="sec-4-2">
        <title>Contributions to Practice</title>
        <p>Alongside and based on the contributions to theory, the thesis is expected
to make a number of contributions to practice. We categorize them by
software artefact.</p>
        <p>
          Graph Database and Key{Value store: To the best of our
knowledge, ChronoGraph will be the rst implementation of the Apache
Tinkerpop API that o ers full versioning support which is provided by the
temporal key{value store in ChronoDB. Lightweight branching, as seen
in popular version control systems such as Git or SVN, is also part of
the versioning engine. ChronoGraph will be the rst graph database
with full ACID transaction support with the highest possible isolation
level (\serializable" [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]). By taking advantage of versioning, ChronoDB
and ChronoGraph support long{running transactions without sacri cing
throughput of concurrent short-lived transactions, which is of
particular importance in modeling scenarios that involve model analysis. Both
ChronoDB and ChronoGraph o er timestamp{agnostic queries that can
be executed on any model version in time without modi cations by
injecting the desired timestamp from the transaction metadata. This can
be used in a variety of ways, e.g. for after{the{fact collection of time
series data in the history, or for comparing the result of a model query
at two di erent points in time. Temporal indices allow for equal query
performance on any model version, while temporal con ict detection
protects users from history corruption, data loss and other anomalies.
Model Repository: The ACID nature of ChronoGraph transactions
allows ChronoSphere clients to work on consistent views on the EMF
Ecore model data, which is important e.g. for analysis and refactoring
tasks. The repository is designed to handle hundred thousands of
individual elements and beyond. This is achieved by lazy loading of
EObjects and their automatic unloading in case they are no longer needed
by the application. In order to support the insertion of large models into
the repository, ChronoSphere provides batch{based incremental commits
that are internally merged into a single model version when the last batch
is written. ChronoSphere aims for the best possible EMF ecosystem
integration and to provide EObjects that are compatible with popular
Ecore{based frameworks, such as EMF Compare.
5
        </p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Plan for Evaluation and Validation</title>
      <p>
        The research methodology applied for this thesis follows the principles
of Design Science as de ned by Pe ers [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] and Hevner [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. The system
will be evaluated using a variety of techniques:
{ Prototype Implementation: The implementation of the
prototype serves as the proof{of{concept for the theoretical foundations
and is the main design artefact. An extensive automated test suite
developed alongside the prototype will assert that its functionality
behaves as intended and in particular properly implements the
theoretical foundations de ned in the thesis.
{ Performance Measurements: Measuring the performance (e.g.
      </p>
      <p>
        CPU and RAM usage) of the prototype implementation and
comparing it to other model repositories will provide the necessary data
for a discussion on the factual scalability of the model repository.
{ Industrial Case Study: Several Chronos components are already
being used in an industrial setting as the primary storage backend for
the IT Landscape Documentation tool Txture8 [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. The deployment
of Txture with Chronos components at industrial research partners
allows to conduct case studies in real world scenarios beyond
laboratory conditions.
6
      </p>
    </sec>
    <sec id="sec-6">
      <title>Current Status</title>
      <p>As of July 2016, large parts of Chronos have already been implemented.
The core of ChronoDB is complete9, and a paper titled Scalable
Versioning for Key-Value Stores has been accepted by and will be published
at the 5th International Conference on Data Management Technologies
and Applications (DATA 2016). This paper covers the theoretical
foundations and implementation aspects of ChronoDB. The evaluation of the
core components of ChronoGraph as a backend for Txture is currently
ongoing and shows very promising early results with respect to
performance. A publication on this topic is the next step. The implementation
of ChronoSphere is currently work-in-progress. We plan a publication on
this topic at the MODELS Conference 2017. For the nal publication,
we aim for a journal paper in 2018 that summarizes our ndings and
combines them with the results of an industrial case study. We aim for
the conclusion and publication of the PhD thesis by the end of 2018.
8 www.txture.tools
9 https://github.com/MartinHaeusler/chronos/tree/master/chronodb
In this paper, we have provided an overview over the Chronos project
that aims to provide a scalable solution for storing, versioning and
querying model data, based on NoSQL graph and key-value techniques. In
contrast to existing solutions, it will not rely upon XML serialization or
object-relational mappings. Instead, the entire data management stack
will be implemented from scratch, with the use case of storing large
models in mind. The resulting artefact will serve as a proof{of{concept and
will be tested against an automated test suite and in an industrial case
study. Comparative benchmarks with existing repositories are also part
of the evaluation. The planned end of the PhD thesis is in 2018, with a
total of three conference publications and one journal paper.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Benelallam</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gomez</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , et al.:
          <article-title>Neo4EMF, a scalable persistence layer for EMF models</article-title>
          .
          <source>In: Modelling Foundations and Applications</source>
          , pp.
          <volume>230</volume>
          {
          <fpage>241</fpage>
          . Springer (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Di</given-names>
            <surname>Rocco</surname>
          </string-name>
          ,
          <string-name>
            <surname>J.</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Di</given-names>
            <surname>Ruscio</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Iovino</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            ,
            <surname>Pierantonio</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          :
          <article-title>Collaborative Repositories in Model-Driven Engineering</article-title>
          .
          <source>IEEE Software 32(3)</source>
          ,
          <volume>28</volume>
          { 34 (May
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Di</given-names>
            <surname>Ruscio</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>De Lara</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Pierantonio</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          :
          <source>Proceedings of the 3rd Workshop on Extreme Modeling at MoDELS</source>
          <year>2014</year>
          . CEUR, Valencia, Spain (
          <year>2014</year>
          ), http://ceur-ws.
          <source>org/</source>
          Vol-
          <volume>1239</volume>
          /
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Felber</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pasin</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , et al.:
          <article-title>On the Support of Versioning in Distributed Key-Value Stores</article-title>
          .
          <source>In: 33rd IEEE International Symposium on Reliable Distributed Systems, SRDS</source>
          <year>2014</year>
          , Nara, Japan, October 6-
          <issue>9</issue>
          ,
          <year>2014</year>
          . pp.
          <volume>95</volume>
          {
          <issue>104</issue>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Gomez</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tisi</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sunye</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cabot</surname>
          </string-name>
          , J.:
          <article-title>Map-Based Transparent Persistence for Very Large Models</article-title>
          .
          <source>Fundamental Approaches to Software Engineering</source>
          <volume>9033</volume>
          , 19{
          <fpage>34</fpage>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Hevner</surname>
            ,
            <given-names>A.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>March</surname>
          </string-name>
          , S.T.,
          <string-name>
            <surname>Park</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ram</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Design Science in Information System Research</article-title>
          .
          <source>MIS Quaterly</source>
          <volume>28</volume>
          (
          <issue>1</issue>
          ),
          <volume>75</volume>
          {
          <fpage>105</fpage>
          (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7. ISO:
          <article-title>SQL Standard 2011 (ISO</article-title>
          /IEC 9075:
          <year>2011</year>
          ) (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8. Object Management Group:
          <article-title>UML 2.3 Superstructure (</article-title>
          <year>2010</year>
          ), http: //www.omg.org/spec/UML/2.3
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>OMG: XML Metadata</surname>
          </string-name>
          <article-title>Interchange (XMI)</article-title>
          .
          <source>OMG</source>
          (
          <year>2007</year>
          ), http://www.omg.org/technology/documents/modeling_spec_ catalog.htm#XMI
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10. (OMG),
          <string-name>
            <surname>O.M.G.</surname>
          </string-name>
          :
          <article-title>Object constraint language (ocl)</article-title>
          .
          <source>version 2</source>
          .3.
          <issue>1</issue>
          (
          <issue>2012</issue>
          ), http://www.omg.org/spec/OCL/2.3.1/
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11. Pe ers,
          <string-name>
            <given-names>K.</given-names>
            ,
            <surname>Tuunanen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            ,
            <surname>Rothenberger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.A.</given-names>
            ,
            <surname>Chatterjee</surname>
          </string-name>
          ,
          <string-name>
            <surname>S.:</surname>
          </string-name>
          <article-title>A design science research methodology for information systems research</article-title>
          .
          <source>Journal of management information systems 24(3)</source>
          ,
          <volume>45</volume>
          {
          <fpage>77</fpage>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Steinberg</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Budinsky</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Merks</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Paternostro</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>EMF: eclipse modeling framework</article-title>
          .
          <source>Pearson Education</source>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Trojer</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Farwick</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , Hausler,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Breu</surname>
          </string-name>
          , R.:
          <article-title>Living Models of IT Architectures: Challenges and Solutions</article-title>
          .
          <source>Software, Services and Systems</source>
          <volume>8950</volume>
          ,
          <fpage>458</fpage>
          {
          <fpage>474</fpage>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>