Home » DevOps » Database migrations in Kubernetes applications with Flyway

About Sebastian Daschner

Sebastian Daschner
Sebastian Daschner is a self-employed Java consultant and trainer. He is the author of the book 'Architecting Modern Java EE Applications'. Sebastian is a Java Champion, Oracle Developer Champion and JavaOne Rockstar.

Database migrations in Kubernetes applications with Flyway

I’ve recorded a video how to migrate databases for applications that are deployed in a managed Kubernetes environment using Flyway and init containers. In order to achieve zero-downtime deployments, we need to make sure that our persistence concept supports N-1 compatibility, which requires us to be able to migrate our database schemas, ideally from reproducible scripts stored in version control.

Flyway is a widely-used tool to perform such migrations in an idempotent way.

In the video, I’m using Flyway in the command line mode, which will be packaged to a Docker image together with the migration scripts. We’ll use the image to perform the database migrations inside init containers, which run just before the deployment of our applications.

You can find the example project on GitHub. In the video, I use the managed IBM Cloud Kubernetes service and Databases for PostgreSQL service.

Further resources

Published on Java Code Geeks with permission by Sebastian Daschner, partner at our JCG program. See the original article here: Database migrations in Kubernetes applications with Flyway (Video)

Opinions expressed by Java Code Geeks contributors are their own.

(0 rating, 0 votes)
You need to be a registered member to rate this.
Start the discussion Views Tweet it!
Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments