alter your database schema over time in a consistent and easy way. https://en.wikipedia.org/wiki/Schema_migration You can think of each migration as being a new 'version' of the database. A schema starts off with nothing in it, and each migration modifies it to add or remove tables, columns, or entries. Database Migrations knows how to update your schema along this timeline, bringing it from whatever point it is in the history to the latest version.
environment (local, uat, production), just run the database migration. Easy to track database changes (for code review) before run in production. Easy to rollback if something wrong in new migration script. Consistent default data in every database environment (local, uat, production).
and Mongobee for database migrations. All FlywayDB and Mongobee script will be included in the app. For Elasticsearch, we manually create schema using CURL, ups!
new migration script, we need to redeploy the app, because migration script embedded in the app, even there is no changes in the app . For microservice that using more than one datastore, like x-fraud (using mongodb and elasticsearch), it’s a nightmare . If there is hot fix migration script, engineer will send request to dbadmin using JIRA. And it’s hard to track the migration script if using JIRA. For new engineer, good luck, you can not simulate migration from the first database creation, if you want to setup the database in your local computer, please dump the database from UAT
last 2 migration scripts, let’s rollback the migrations. Ups, but wait? How to rollback the migrations? Hmm, just create new migrations that rollback the last 2 migration script. Oh, ok I already rollback the mongodb migrations, but it’s still broken, the app is not working. Ups, sorry I forget, you also need to rollback the schema in elasticsearch. Etc.
every one can fork the project if want to create database-migration project for their apps. You can get the project template here : https://stash.gdn-app.com/projects/SANDBOX/repos/database- migration/browse For example, hotel-search fork and create new database-migration project here : https://stash.gdn-app.com/projects/HOTEL/repos/hotel-search- database/browse
JVM). Ruby is developer friendly language, simple and dynamic, we don’t need to compile the project, just write and run. For Relational Database, the project using http://sequel.jeremyevans.net/ library. For MongoDB, the project using https://docs.mongodb.com/ruby- driver/master/ For Elasticsearch, the project using https://github.com/jnunemaker/httparty