Need liquibase alternative for mongodb and / or cassandra databases

We recently encountered a problem. We want to do version control as patch management (similar to git for the codebase) for both mbodb and Cassandra db schema changes and update / insert requests. Liquibase processes it only for mysql. We need an alternative to Liquibase for nosql mongodb and cassandra.

+7
version-control database mongodb cassandra nosql
source share
4 answers

There are some tools for Mongo, examples:

  • Mongeez:

    • https://github.com/mongeez/mongeez
    • Benefits
      • Store scripts in .js files.
      • XML file for their organization
      • If you use Java, Mongeez can be integrated with Spring, so you can run scripts at application startup
    • Disadvantages:
      • dead project
      • use db.eval() , which is deprecated in MongoDB since version 3.0
  • Mongobee:

    • https://github.com/mongobee/mongobee
    • advantages:
      • all code in java
      • integrates easily with Spring
      • good tutorial how to use it.
    • Disadvantages:
      • All scripts must be executed in Java, unable to write them in JS
+5
source share

I don’t think you will ever see such a tool for Mongo. The reason is that Mongo has no real use of the schema, so you need to query and convert. In other words, for this you need to write your own scripts. This is one of the reasons why I highly recommend putting the version number of the data structure in the data structure and putting a secondary index on it.

For Cassandra, the problems are different, and changing the data structure can also be a little painful. Again, such a tool could add or remove columns, but it would not be able to address map or list types or the like. I doubt the problems are well understood for common tools, but of course, see https://github.com/comeara/pillar .

For Mongo, the solution will look much more like a script that pulls out old structures and saves them again with new information. For Cassandra, the pillar may help with its part, but for some types you may need more. Keep in mind that collection types in Cassandra are not really structured in a schema.

+1
source share

I wrote a very simple application for basic support for schema updates in cassandra. See: enter the link here

Main usage: java -jar cassandra-schem.jar --cassandra.keyspace = myspace --scheme.dir = / mydir

+1
source share

There is a branch forked from Flyway which seems to support mongoDB: https://github.com/risksense/flyway/tree/release-4.0.3-mongodb

Not tested, but seems promising.

0
source share

All Articles