<!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>
      <journal-title-group>
        <journal-title>M. J. Mior);</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>migration in column family database evolution using</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Pablo Suárez-Otero</string-name>
          <email>suarezgpablo@uniovi.es</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Michael J. Mior</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>María José Suárez-Cabal</string-name>
          <email>cabal@uniovi.es</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Javier Tuya</string-name>
          <email>tuya@uniovi.es</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="editor">
          <string-name>Model-Driven Engineering, Database evolution, Data Migration, NoSQL, Denormalization</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Rochester Institute of Technology, Golisano College of Computing and Information Sciences</institution>
          ,
          <addr-line>Rochester</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Oviedo, Campus de Viesques</institution>
          ,
          <addr-line>Gijón</addr-line>
          ,
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <volume>000</volume>
      <fpage>0</fpage>
      <lpage>0001</lpage>
      <abstract>
        <p>When software requirements change, databases used by an application may evolve, including the database models (conceptual model and schema), which may require data migrations to maintain data integrity. In some databases such as NoSQL column family databases, the tables of the database often store repeated data, as schema denormalization is encouraged to achieve the best performance. This makes data integrity maintenance more complex, as a single conceptual model change may trigger several changes in the schema. In this work, we propose using a model-driven engineering approach named MoDEvo for data migration in NoSQL column family databases to maintain data integrity after the schema evolves. Using a motivating example as a case study from an open source project that requires data migration, we describe MoDEvo and use it to illustrate how MoDEvo determined these data migrations.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        The requirements of a project determine how the
tual model during the design phase. This is especially
important for some database types such as NoSQL
column family databases (e.g. Apache Cassandra) where
the schema is usually denormalized [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ]. A change in
nEvelop-O
(J. Tuya)
ceptual model and the schema (tables in the database),
which can create data integrity problems due to losing
the synchronization between the conceptual model and
the schema [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. This problem is more dificult to solve in
databases where data is duplicated among the tables and
where the primary keys of the tables might not match the
primary keys of the conceptual model [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. This happens
in the aforementioned NoSQL column family databases,
where each table is designed so that a specific query can
be executed against it, implying a denormalization of the
schema as the same datum can be queried more than
once and is therefore stored in several tables [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>In NoSQL column family databases, the schema is more
lfexible than in a relational database and does not have
integrity constraints, which makes mistakes during schema
evolution more likely. A single change in one table must
Published in the Workshop Proceedings of the EDBT/ICDT 2023 Joint
2.</p>
    </sec>
    <sec id="sec-2">
      <title>Motivating example</title>
      <p>We use as a motivating example a schema change from
the open-source project   
‘team’ was added to the primary key of the table
“issuer_idp”. As it is not possible to directly alter the
pri1 in which the column</p>
      <sec id="sec-2-1">
        <title>1https://github.com/wireapp/wire-server</title>
        <p>mary key of a table, a new table: “issuer_idp_v2” was
created, which is illustrated in Figure 1.</p>
      </sec>
      <sec id="sec-2-2">
        <title>To maintain data integrity, each row of “issuer_idp”</title>
        <p>
          must be migrated to “issuer_idp_v2”, adding the
appropriate value for column ‘team’ to complete each row. Values
of column ’team’ must be obtained from table “idp” as it
is displayed in Figure 2.
(Data migration model creation), MoDEvo determines
through model transformations implemented in ATL [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]
the “Data migration model” (conforms to the metamodel
illustrated in Figure 4), which contains the data
migrations. In the second phase (DB statement creation),
the “Data migration model” is transformed, through M2T
(model to text) transformations, into a script that
contains the database statements required to perform the
data migrations. In the third phase (Data migration
        </p>
        <p>It is important to note, that this migration is still not execution), MoDEvo sends this script to a migration
being executed by the developers of the project. They engine (e.g. Apache Spark) to execute the script. We
have left the previous table to be queried for the data that focus on the two first phases.
was previously stored and a TODO task to migrate the A Data Migration model (Figure 4) contains a
Migradata in the future. Maintaining the old table “issuer_idp” tionTable element for each target table that requires data
jeopardizes data integrity, as both tables are actually stor- migrations in some of its columns. For each of these
taring diferent data, although they are intended to store the get columns, a MigrationCol element is defined, which
same relationship between entities “issuer” and “idp”. In determines this target column that receives data and the
the next section, we propose MoDEvo to avoid scenarios source column that provides the data.
like this one. The target and source columns are specified through
references to Target and Source elements, which likewise
contain the references ‘Data’ and ‘Key’ to schema column</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. MoDEvo description elements:</title>
      <p>In this section we propose MoDEvo, an MDE approach
that determines the required migrations of data to
maintain data integrity when the schema evolves. Figure 3
displays the MoDEvo process divided in three phases
(middle row) alongside its inputs (top row) and results
of each phase (bottom row), which are also inputs in the
following phase.</p>
      <p>In the first two phases, MoDEvo receives the
information of the evolution of the schema through 3 input
models: 1) the conceptual model, 2) the schema before
the change and, 3) the schema change. In the first phase
• ‘Data’: Indicates the source column from where
data will be obtained and the target column
where data will be inserted.
• ‘Key’: Indicates a functional dependency that the
‘Data’ column has with other columns, which
makes it possible to determine the specific data
to insert in each row of the ‘Data’ target column.</p>
      <p>MoDEvo determines a functional dependency if
the following condition is met: Being a column
Datac mapped to a non-key attribute Dataa and
a set of columns Keyc, mapped to a set of key
attributes Keya, if Keya → Dataa then Keyc →
Datac.</p>
      <p>databases such as MongoDB by determining the required
data migrations. Focusing on column family DBs, Störl</p>
      <p>
        When applying MoDEvo to the case study from the mo- et al have addressed other issues, such as optimizing the
tivating example, it first analyzes the conceptual model, performance of these databases [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] as well as reducing
the schema and the schema change to create the migra- the monetary cost of the infrastructures where they are
tion model (displayed in Figure 5 graphically and textu- deployed [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
ally). MoDEvo then sets ‘team’ as ‘Data’ column in both Data integrity in column family databases have been
the Source table “issuer_idp_v2” and the Target table researched for several problems, such as analyzing how
“idp”. Likewise, columns ‘issuer’ and ‘idp’ are set as ‘Key’ malicious attacks can afect data integrity [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. We also
columns, as they will be used to determine which value addressed the maintenance of the data integrity when
of ‘team’ stored in the source table is inserted in each the data changes [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. However there has not been any
row of the target table. Additionally, the element Mi- research that addressed the maintenance of data integrity
grationTable references the target table and its previous when the schema evolves in column-family databases.,
version through the attributes Table and TablePrev. which is what we address in this work.
      </p>
      <p>
        Using the generated model, MoDEvo creates through We made a first approach for database evolution [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]
M2T transformation the data migration script. This script by identifying the conceptual model changes that
occontains the database statements to: 1) obtain the data curred in a set of open-source projects. We determined
stored in each row of the previous table “issuer_idp”, that after one of these changes three processes must be
2) associate these data with the appropriate value for performed: 1) schema evolution, 2) data migrations to
the column ‘team’ and, 3) insert the data in the target maintain data integrity and 3) update client application.
table “issuer_idp_v2”. Finally, this script will be sent to a In another work [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] we also considered the scenario
migration engine. The resulting migration was illustrated where the schema changes and the conceptual model
in the previous section in Figure 2. needs to be updated. However, in neither of these works
      </p>
      <p>
        After the migration is performed, the previous table “is- [
        <xref ref-type="bibr" rid="ref11 ref3">11, 3</xref>
        ] we focused on the details of the aforementioned
suer_idp” can be removed, avoiding the problems related processes.
to data integrity that were detailed in Section 2.
      </p>
    </sec>
    <sec id="sec-4">
      <title>4. Related Work</title>
      <sec id="sec-4-1">
        <title>In this work, we propose MoDEvo, a MDE approach that</title>
        <p>
          Database migrations for column family databases have provides the migrations required to maintain data
inbeen approached in several work by Störl et al. [
          <xref ref-type="bibr" rid="ref6 ref7 ref8 ref9">6, 7, 8, 9</xref>
          ]. tegrity when a column family database schema changes.
In two of these works [
          <xref ref-type="bibr" rid="ref7 ref9">9, 7</xref>
          ], the authors also addressed MoDEvo helps developers to avoid scenarios like the one
the maintenance of data integrity on document-oriented presented in Section 2 where a deprecated table was kept
5. Conclusions
in the schema because their data was not migrated to
the tables that are being used at the moment.
Maintaining deprecated tables increases the risk of having issues
regarding data integrity, as they are storing data that is
not consistent with the rest of the database. MoDEvo
reduces this risk by making legacy tables unnecessary.
        </p>
        <p>MoDEvo also reduces the time that developers need
to employ when evolving the database, as it
automatically determines what needs to be migrated. Developers
will have a script with the database statements that are
required to perform all the data migrations needed to
maintain the data integrity.</p>
        <p>
          As future work, we plan to complete MoDEvo by
developing its third phase and migrate data by sending the
data migration script to a migration engine. We also
plan to combine our previous work for schema evolution
[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] with MoDEvo. With this combination, we will
provide at the same time what needs to be changed in the
schema and what data migration must be executed to
maintain the data integrity for any requirement change
that modifies the conceptual model.
        </p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgments</title>
      <sec id="sec-5-1">
        <title>This work was supported in part by projects [TIN2016</title>
        <p>76956-C3-1-R] funded by the Spanish Ministry of
Economy and Competitiveness, [PID2019-105455GB-C32]
funded by MCIN/ AEI/10.13039/501100011033 and the
Severo Ochoa pre-doctoral grant PA-21-PF-BP20-184.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Chebotko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Kashlev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Lu</surname>
          </string-name>
          ,
          <article-title>A big data modeling methodology for Apache Cassandra</article-title>
          , in: 2015
          <source>IEEE International Congress on Big Data</source>
          , IEEE,
          <year>2015</year>
          , pp.
          <fpage>238</fpage>
          -
          <lpage>245</lpage>
          . doi:
          <volume>10</volume>
          .1109/BigDataCongress.
          <year>2015</year>
          .
          <volume>41</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>M. J.</given-names>
            <surname>Mior</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Salem</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Aboulnaga</surname>
          </string-name>
          , R. Liu, Nose:
          <article-title>Schema design for NoSQL applications</article-title>
          ,
          <source>IEEE Transactions on Knowledge and Data Engineering</source>
          <volume>29</volume>
          (
          <year>2017</year>
          )
          <fpage>2275</fpage>
          -
          <lpage>2289</lpage>
          . doi:
          <volume>10</volume>
          .1109/TKDE.
          <year>2017</year>
          .
          <volume>2722412</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>P.</given-names>
            <surname>Suárez-Otero</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. J.</given-names>
            <surname>Mior</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. J.</given-names>
            <surname>Suárez-Cabal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Tuya</surname>
          </string-name>
          ,
          <article-title>An integrated approach for columnoriented database application evolution using conceptual models</article-title>
          ,
          <source>in: International Conference on Conceptual Modeling</source>
          , Springer,
          <year>2021</year>
          , pp.
          <fpage>26</fpage>
          -
          <lpage>32</lpage>
          . doi:js5t.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>M. J.</given-names>
            <surname>Suárez-Cabal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Suárez-Otero</surname>
          </string-name>
          , C. de la Riva, J. Tuya, MDICA:
          <article-title>Maintenance of data integrity in column-oriented database applications</article-title>
          ,
          <source>Computer Standards &amp; Interfaces</source>
          <volume>83</volume>
          (
          <year>2023</year>
          )
          <article-title>103642</article-title>
          . doi:
          <volume>10</volume>
          .1016/j.csi.
          <year>2022</year>
          .
          <volume>103642</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>F.</given-names>
            <surname>Jouault</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Allilaire</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Bézivin</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Kurtev</surname>
          </string-name>
          ,
          <article-title>ATL: A model transformation tool</article-title>
          ,
          <source>Science of computer programming 72</source>
          (
          <year>2008</year>
          )
          <fpage>31</fpage>
          -
          <lpage>39</lpage>
          . doi:
          <volume>10</volume>
          .1016/ j.scico.
          <year>2007</year>
          .
          <volume>08</volume>
          .002.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A.</given-names>
            <surname>Hillenbrand</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Levchenko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            <surname>Störl</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Scherzinger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Klettke</surname>
          </string-name>
          ,
          <article-title>Migcast: putting a price tag on data model evolution in NoSQL data stores</article-title>
          ,
          <source>in: Proceedings of the 2019 International Conference on Management of Data</source>
          ,
          <year>2019</year>
          , pp.
          <fpage>1925</fpage>
          -
          <lpage>1928</lpage>
          . doi:
          <volume>10</volume>
          .1145/3299869.3320223.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>A.</given-names>
            <surname>Hillenbrand</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            <surname>Störl</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Nabiyev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Klettke</surname>
          </string-name>
          ,
          <article-title>Selfadapting data migration in the context of schema evolution in NoSQL databases</article-title>
          ,
          <source>Distributed and Parallel Databases</source>
          (
          <year>2021</year>
          )
          <fpage>1</fpage>
          -
          <lpage>21</lpage>
          . doi:10/js5k.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>M. L.</given-names>
            <surname>Möller</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Klettke</surname>
          </string-name>
          , U. Störl,
          <article-title>Evobench-a framework for benchmarking schema evolution in NoSQL</article-title>
          , in: 2020
          <source>IEEE International Conference on Big Data (Big Data)</source>
          , IEEE,
          <year>2020</year>
          , pp.
          <fpage>1974</fpage>
          -
          <lpage>1984</lpage>
          . doi:
          <volume>10</volume>
          .1109/BigData50022.
          <year>2020</year>
          .
          <volume>9378278</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>M.</given-names>
            <surname>Klettke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            <surname>Störl</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Shenavai</surname>
          </string-name>
          , S. Scherzinger,
          <article-title>NoSQL schema evolution and big data migration at scale</article-title>
          ,
          <source>in: 2016 IEEE International Conference on Big Data (Big Data)</source>
          , IEEE,
          <year>2016</year>
          , pp.
          <fpage>2764</fpage>
          -
          <lpage>2774</lpage>
          . doi:
          <volume>10</volume>
          .1109/BigData.
          <year>2016</year>
          .
          <volume>7840924</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>G.</given-names>
            <surname>Weintraub</surname>
          </string-name>
          , E. Gudes,
          <article-title>Data integrity verification in column-oriented NoSQL databases</article-title>
          ,
          <source>in: Data and Applications Security and Privacy XXXII: 32nd Annual IFIP WG 11.3 Conference</source>
          , DBSec
          <year>2018</year>
          , Bergamo, Italy,
          <source>July 16-18</source>
          ,
          <year>2018</year>
          , Proceedings 32, Springer,
          <year>2018</year>
          , pp.
          <fpage>165</fpage>
          -
          <lpage>181</lpage>
          . doi:
          <volume>10</volume>
          .1007/ 978-3-
          <fpage>319</fpage>
          -95729-6_
          <fpage>11</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>P.</given-names>
            <surname>Suárez-Otero</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. J.</given-names>
            <surname>Mior</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. J.</given-names>
            <surname>Suárez-Cabal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Tuya</surname>
          </string-name>
          ,
          <article-title>Maintaining NoSQL database quality during conceptual model evolution</article-title>
          , in: 2020
          <source>IEEE International Conference on Big Data (Big Data)</source>
          , IEEE,
          <year>2020</year>
          , pp.
          <fpage>2043</fpage>
          -
          <lpage>2048</lpage>
          . doi:
          <volume>10</volume>
          .1109/BigData50022.
          <year>2020</year>
          .
          <volume>9378228</volume>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>