Database Lifecycle in Jmix: Migration Challenges

Introduction

In Jmix, the JPA data model, hence database is a cornerstone of the application.

In the case of software development, the principle “if it works, don’t touch it” does not always work. Software changes are inevitable, database migrations too. And, if a database update goes wrong, you can lose data, which is one of the most valuable things for the business.

JPA Goes Even Easier With its Buddy

So, Hello World... After almost a year of development, the first version of JPA Buddy has finally been released! This is a free tool that is supposed to become your faithful coding assistant for projects with JPA and everything related: Hibernate, Spring Data, Liquibase, and other mainstream stacks.

"Why would I use it?" - this is a fair question towards any new tool or framework. In short, if you use JPA for data persistence, JPA Buddy will help you to be more efficient. In this article, I'll present an overview of the tool. I hope it will take its fair place among the most loved tools for Java developers, ones who use JPA, Spring, Liquibase, and of course the most advanced Java IDE - IntelliJ IDEA.

Database Migration tools: Flyway vs. Liquibase

I believe that there is no need for describing why the usage of database migration tools is vital for modern days apps that utilize relational database engines. I will only say that they can make our life much easier and help us to automatize a complex and repetitive process.

Through the course of this article, I will provide some more insights into similarities and differences between two of the most common open-source migration tools, namely Flyway and Liquibase.

DAO Integration Test With TestContainers, Spring Boot, Liquibase, and PostgresSQL

In this article, we will cover how to do a DAO integration test when you have a spring boot application with PostgreSQL DB and Liquibase for schema versioning. Last time, we explained how to do the same without Liquibase using embedded PostgreSQL, but this time, we will do the same but use Docker with test containers, which will apply your Liquibase changes and make sure your DAO integration test has the same environment as the production database environment if you are using Docker for your database in production.

The whole code example is on GitHub.