Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
What is it?
cassandra-migration is a simple and lightweight Apache Cassandra and DataStax Enterprise database schema migration tool. It is designed to work similar to Flyway with support for both plain CQL and Java-based migrations, using DataStax's Cassandra Java driver in its implementation.
The tool does not roll back the database upon migration failure. You're expected to manually restore backup.
Project Rationale and FAQ
Why not create an extension to an existing popular database migration project (i.e. Flyway)?
Popular database migration tools (e.g. Flyway, Liquibase) are tailored for relational databases with JDBC. This project exists due to the need for Cassandra-specific tooling:
- CQL != SQL,
- Cassandra is distributed and does not have ACID transactions,
- Cassandra do not have native JDBC driver(s),
Why not extend the existing Cassandra Migration project?
The project this tool is based on (Contrast-Security-OSS / cassandra-migration) does not seem to be actively maintained any more. Several important PRs have been left open for months and there was an immediate need to support Cassandra driver v3.x.
There are various reasons why Kotlin was chosen, but the three main reasons are:
- code brevity and reduced noise,
nullchecks (enforced at the compiler level), and
- better Java collection support (e.g. additional functional features)
Should you find this tool does not fit your needs, there exists several other open-source libraries, each with its unique approaches to Cassandra schema migration. By no means this is an exhaustive list, but it might help steer you to the right direction: