...
Type | DataStore | Validation | Query | Index |
---|---|---|---|---|
longtext | MariaDB | SELECT | Yes | No |
longtext | PostgreSQL | No | No | No |
json | PostgreSQL | INSERT / UPDATE | Yes | No |
jsonb | PostgreSQL | INSERT / UPDATE | Yes | Yes |
Conclusion
My suggestion as shown below is three options:
- replace all ElementCollections with Converters (Minimum change with Minimum improvement):
- A lot of small Jsons
- Using longtext, we are be able to maintain compatibility with MariaDB
- Minimum Java code impact
- 50% of tables (with postfix as _ATTRIBUTES, _PROPERTIES, _META METADATA, _OCCURRENCES, _CONSTRAINTS, _TARGETS, _TRIGGERS and _INPUTS) will be removed
- Unit tests not need to change
- ToscaServiceTemplace as Unique Json String:
- One big Json for each model (e.g. saving the whole ToscaServiceTemplace as Json)
- Using jsonb only PostgreSQL, will be supported
- Medium Java code impact: all persistence classes could be removed or have to be equal to original model
- 90% of tables will be removed
- Unit tests need PostgreSQLContainer
- Cassandra
- Document oriented approach full supported by SpringBoot (not needs Converters)
- Huge Java code impact: All repositories and all persistence classes have to change
- No support for MariaDB and PostgreSQL anymore
- Unit tests need an Embedded Cassandra Server (EmbeddedCassandraServerHelper or CassandraContainer)
...