Is it possible use Flyway to perform NoSQL migrations?
Asked Answered
A

3

8

Flyway can be configured to execute migrations on a NoSQL database (i.e. via Java API) or it is designed only for relational databases?

Amagasaki answered 10/2, 2015 at 8:53 Comment(3)
I think that Fyway's documentation is clear enogh. How would you even migrate the schema of a schemaless database?Sectary
In your opinion data in a schemaless database cannot change their form during the lifetime of an application?Amagasaki
This is not a matter of opinion. Schemaless databases do not have schemas and Flyway is first and foremost about schema migration. Additionally it is a tool which assumes JDBC as the connectivity API. JDBC assumes SQL as the database conversation language. All this is quite clear from Flyway's documentation, along with an exhaustive list of all the databases it supports.Sectary
T
5

There is no explicit support at this time. What you can however do is use Flyway in combination with both a relational and a NoSQL db. Flyway would then keep its metadata table in the relational DB and you would write Java migrations to migrate the NoSQL datastore.

Timberland answered 11/2, 2015 at 9:9 Comment(1)
Although a better abstraction would be preferable (decoupling the Flyway API from JDBC), this is a good compromise. Thanks Axel!Amagasaki
G
4

It is now possible to use Flyway to perform NoSQL Migrations and is not just designed for relational databases. Migrations can be written using JavaScript and can run in Flyway using Flyway 'migrate' command for MongoDB. The MongoDB support is available in any version after v10.1.0. Other NoSQL Databases are going to be added in the future to Flyway such as Cassandra and Redis.

Gerbold answered 27/11, 2023 at 10:30 Comment(0)
M
1

An alternative to flyway for MongoDB migration is Monjam (https://github.com/oun/monjam). It has gradle plugin to run the migration. You can write migration in java or js script.

Machree answered 4/8, 2019 at 13:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.