Is there a schema version control tool for cassandra

In the sql world, a tool is often used that goes through the schema scripts folder to configure some schema. A widely used approach is to have a table containing the current db version number and ddl scripts so that we can start with any db version and update any subsequent version with the controller. Visual Studio has db projects, redgate have similar tools.

I was wondering if there was anything for Cassandra. I know that it will not be too difficult to implement something basic for cassandra, but it was interesting, someone had already done it.

+6
source share
5 answers

Your initial question did not specify a language, although you will later indicate that you want C #. I have no answer in C #, but I extracted the Java version control component that I use for my project. I also created a small example project that shows how to integrate it. These are bare bones. There are different approaches to this problem, so I chose the one that was easy to build and does what I need. Here are two GitHub projects:

https://github.com/DonBranson/cql_schema_versioning

https://github.com/DonBranson/cql_schema_versioning_example

This component does not store version # in the schema, but stores a list of scripts that it runs. It depends on the sort order of the script names to determine the execution order. Very simple.

+5
source

Pillar manages migrations for your Cassandra data warehouses.

The pillar grew out of a desire to automatically control Cassandra's scheme as a code. Managing the schema as a code allows you to automate assembly and deployment, a fundamental practice for organizations looking to achieve continuous delivery.

Pillar is Cassandra that Rails ActiveRecord migrations or Play Evolutions are relational databases with one key difference: Pillar is completely independent of any application development infrastructure.

https://github.com/comeara/pillar

+7
source

Kassandra is "schematic" in nature, it is a structured keystore, so it is very different from traditional rdbms in this regard.

Cassandra has now evolved into "schema-optional" because it allows you to describe common data types that live in a particular column family.

Try a look at Liquibase and / or Flyaway to see if the extensions provide the versioning options you need.

http://bungeedata.blogspot.com/2013/12/liquibase-and-cassandra.html

http://www.datastax.com/dev/blog/schema-in-cassandra-1-1

http://planetcassandra.org/blog/schema-vs-schema-less/

+1
source

I was looking for a schema migration tool that could be used for the following scenarios:

Automatically upgrade to schema when deploying the application. Allow populating Cassandra databases for integration tests. After some searches, I found the following two that look like potential candidates:

https://github.com/Contrast-Security-OSS/cassandra-migration https://github.com/DonBranson/cql_schema_versioning

+1
source

I do not know anything that exists today.

To the extent that you use CQL , you could probably come up with something, but you will probably run into problems with CQL's limited capabilities to modify tables and then the transformation phase.

When I used these types of tools with SQL, I always got a bunch of SQL to update the dataset after applying the updated DDL.

With CQL, I had to write code that will be applied after changing the schema.

If all you do is add or remove tables, columns and indexes, it should be done.

0
source

Source: https://habr.com/ru/post/973761/


All Articles