# AMANDA: A Middleware for Automatic Migration between Different Database Paradigms
## 4 Evaluation
### Case Study with the Northwind Dataset  
For this case study with Northwind, two versions of the same dataset were used in the experiment, thus allowing for a migration assessment for the two scenarios described in _Migration Speed_. Figure 4 shows the Northwind database schema. Although the datasets are the same, the RDBMS source databases are not homogeneous. In Postgres, there are 91 _customers_, but in MySQL, there are 93 of them. The same goes for _shippers_. The number of rows for each table can be seen in Tables 2 and 3. Figure 4: Northwind relational schema. Initially, we transformed Figure 4 into a graph, i.e., a set of vertices and edges. AMANDA carried out this process through querying the sources databases, i.e., Postgres and MySQL. Figure 5 illustrates the resulting transformation of the relational schema in a graph model. The experiment was performed with docker-compose running on a computer with an Intel(R) Core(TM) i7-7700 CPU @ 3.60 GHz CPU, 32 gigabytes of RAM, and \(1\) terabyte of storage. The experiments results are shown and discussed on the following pages. AMANDA's data migration correctness is shown in Tables 2 and 3. Both tables contain the number of elements for each relational database table or graph database label, e.g., the source databases contain eight elements in table **categories**. Once the migration process is completed, the target database should also contain eight elements in the **categories** label. Although tables _employeteritories_ and _order_details_ exist in the RDBMS, this is not the case for the graph database, given that, in a graph database, associative tables are converted to edges. \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Databases** & \\ \hline
**Entity** & **Postgres** & **Dgraph** \\ \hline categories & 8 & 8 \\ \hline customers & 91 & 91 \\ \hline employees & 9 & 9 \\ \hline orders & 830 & 830 \\ \hline products & 77 & 77 \\ \hline region & 4 & 4 \\ \hline shippers & 6 & 6 \\ \hline suppliers & 29 & 29 \\ \hline territories & 53 & 53 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Number of migrated elements from Postgres to Dgraph. Figure 5: Northwind graph schema. Besides migration correctness, another significant metric is the time and the computational resources (e.g., memory and CPU) used by the migration process. Table 4 summarizes such metrics, indicating that the entire migration process took but 1 s to complete with both databases running on the same machine. The amount of RAM used was 19.47 MB, and the CPU time was 0.54 s for migration from Postgres to Dgraph; the CPU time for migration from MySQL to Dgraph was 0.57 s. The tools used to measure the performance was _pivinstrument_ ([[https://pivinstrument.readthedocs.io/en/latest/home.html](https://pivinstrument.readthedocs.io/en/latest/home.html)]([https://pivinstrument.readthedocs.io/en/latest/home.html](https://pivinstrument.readthedocs.io/en/latest/home.html)), accessed on 9 May 2022) for execution time, _resource_ ([[https://docs.python.org/3/library/resource.html](https://docs.python.org/3/library/resource.html)]([https://docs.python.org/3/library/resource.html](https://docs.python.org/3/library/resource.html)), accessed on 9 May 2022) for CPU usage and _guppy_ ([[https://pypi.org/project/guppy3/](https://pypi.org/project/guppy3/)]([https://pypi.org/project/guppy3/](https://pypi.org/project/guppy3/)), accessed on 9 May 2022) for memory consumption. We also evaluated the query performance between databases through six queries extracted from Neo4J's tutorial on importing relational data ([[https://neo4j.com/developer/guide-importing-data-and-etl/](https://neo4j.com/developer/guide-importing-data-and-etl/)]([https://neo4j.com/developer/guide-importing-data-and-etl/](https://neo4j.com/developer/guide-importing-data-and-etl/)), accessed on 9 May 2022), namely:  
* Find a sample of employees who sold orders together with the products contained in those orders. * Find the supplier and category for a specific product.