0

I started working on a Java project where the chosen database was the Azure Cosmos DB SQL API, so reading the SQL API Cosmos DB introduction I understood that that SQL, in this case, is only for query and not for data manipulation(insert, delete). The question is: Does it make sense to use a schema migration tool like Flyway/Liquibase for this kind of database?

mattg
  • 66
  • 5

2 Answers2

3

CosmosDb does not have any support for schemas at the database level. It's schema free with an indexing mechanism that allows for efficient querying of arbitrary JSON data. As such, a SQL schema migration tool doesn't make sense in this context and wouldn't work anyways. It's up to your application code to ensure that data is normalized and migrated to new formats if necessary.

Jesse Carter
  • 20,062
  • 7
  • 64
  • 101
  • It makes no sense in terms of db schema migration but it makes sense in terms of db, containers creation, definitions (partition keys, unique keys), stored procedures, versioning of the incremental changes on those components. – raspacorp Oct 13 '22 at 03:49
1

Little late to the party but I think this might help: https://github.com/liquibase/liquibase-cosmosdb. It's an extension for Liquibase for Cosmos DB. So, pretty much what you were looking for!

  • Can someone please share any examples to integrate liquibase-cosmos db to a Java spring boot application? – Boat May 21 '21 at 09:22