|
| 1 | +--- |
| 2 | +title: "Association Storage Migration Time" |
| 3 | +url: /refguide/association-storage-migration-time/ |
| 4 | +weight: 15 |
| 5 | +--- |
| 6 | + |
| 7 | +## Introduction |
| 8 | + |
| 9 | +Mendix allows you to change [association storage type](/refguide/association-storage/) for many-to-one and one-to-one associations and switch between Association Tables (legacy option) or Direct Associations (recommended option). Changing the association storage type in an already deployed app leads to data synchronization which can take significant time depending on the amount of data in the database. |
| 10 | + |
| 11 | +This page contains timings for an example association storage migration that can help you estimate data migration time for your app. |
| 12 | + |
| 13 | +## Scenarios |
| 14 | + |
| 15 | +We performed association storage type migration for associations in the domain model shown below: |
| 16 | + |
| 17 | +{{< figure src="/attachments/refguide/runtime/data-storage/association-storage-migration-time/association-storage-model.png" alt="Test model for association storage migration - click to enlarge" class="no-border" >}} |
| 18 | +(*Click the image to enlarge*) |
| 19 | + |
| 20 | +This domain model was used to measure migration time for the following cases: |
| 21 | + |
| 22 | +- **Many-to-one association:** Each of N objects of entity `Many` is associated to one of 10 objects of entity `ToOne` |
| 23 | +- **One-to-one association:** Each of N objects of entity `One` is associated to one of N objects of entity `ToOne` |
| 24 | +- **10 many-to-one associations in one entity:** Each of N objects of entity `Multiple` has 10 associations to objects of entities `Target01` to `Target10`. This means that there are 10*N associations being migrated. |
| 25 | + |
| 26 | +For every database vendor, we ran migrations for 3 different values of N. For each such configuration, we executed the migration 10 times and measured the average migration time over those 10 runs. |
| 27 | + |
| 28 | +## Measurements |
| 29 | + |
| 30 | +All the time measurements are in seconds (s). |
| 31 | + |
| 32 | +### PostgreSQL |
| 33 | + |
| 34 | +|Associations per table (N)|Many to one|One to one|Many to one, 10 associations in one entity| |
| 35 | +|-|-|-|-| |
| 36 | +|20K|0.176 s|0.194 s|1.08 s| |
| 37 | +|1M|8.3 s|9.2 s|38.1 s| |
| 38 | +|20M|199 s|222 s|850 s| |
| 39 | + |
| 40 | +{{< figure src="/attachments/refguide/runtime/data-storage/association-storage-migration-time/storage-migration-postgres.png" alt="Migration time measurements for PostgreSQL - click to enlarge" class="no-border" >}} |
| 41 | +(*Click the image to enlarge*) |
| 42 | + |
| 43 | +### SQL Server |
| 44 | + |
| 45 | +|Associations per table (N)|Many to one|One to one|Many to one, 10 associations in one entity| |
| 46 | +|-|-|-|-| |
| 47 | +|20K|0.177 s|0.177 s|0.94 s| |
| 48 | +|1M|8.3 s|8 s|42 s| |
| 49 | +|20M|183 s|184 s|1013 s| |
| 50 | + |
| 51 | +{{< figure src="/attachments/refguide/runtime/data-storage/association-storage-migration-time/storage-migration-mssql.png" alt="Migration time measurements for SQL Server - click to enlarge" class="no-border" >}} |
| 52 | +(*Click the image to enlarge*) |
| 53 | + |
| 54 | +### MySQL |
| 55 | + |
| 56 | +|Associations per table (N)|Many to one|One to one|Many to one, 10 associations in one entity| |
| 57 | +|-|-|-|-| |
| 58 | +|20K|0.568 s|0.567 s|6.492 s| |
| 59 | +|1M|19.9 s|22.8 s|295.1 s| |
| 60 | +|20M|473 s|605 s|7318 s| |
| 61 | + |
| 62 | +{{< figure src="/attachments/refguide/runtime/data-storage/association-storage-migration-time/storage-migration-mysql.png" alt="Migration time measurements for MySQL - click to enlarge" class="no-border" >}} |
| 63 | +(*Click the image to enlarge*) |
| 64 | + |
| 65 | +### SAP HANA |
| 66 | + |
| 67 | +|Associations per table (N)|Many to one|One to one|Many to one, 10 associations in one entity| |
| 68 | +|-|-|-|-| |
| 69 | +|20K|0.132 s|0.148 s|1.17 s| |
| 70 | +|1M|3.2 s|3 s|18.9 s| |
| 71 | +|20M|23.1 s|27.9 s|184.7 s| |
| 72 | + |
| 73 | +{{< figure src="/attachments/refguide/runtime/data-storage/association-storage-migration-time/storage-migration-saphana.png" alt="Migration time measurements for SAP HANA - click to enlarge" class="no-border" >}} |
| 74 | +(*Click the image to enlarge*) |
0 commit comments