I'm going to use liquibase as application start plugin in some concurrent environment(clustering or multithread initialization). Is there any guarantee of the correct database update in concurrent environment, which is supported by liquibase library, or i have to do it manually? Thank you!
While both tools are based on Martin Fowler's Evolutionary Database, there are many differences in what these tools offer. Here's where Liquibase and Flyway differ. The bottom line is that Liquibase is more powerful and flexible — covering more database change and deployment use cases than Flyway.
Liquibase offers a powerful open source database migration tool for Java apps. It brings structure and confidence to developers and DBAs that need to easily create and track database schema changes.
Liquibase allows you to specify the database change you want using SQL or several different database-agnostic formats, including XML, YAML, and JSON. Developers can abstract the database code to make it extremely easy to push out changes to different database types.
Liquibase does implement an exclusive lock, using the ACID transactional features of your RDBMS. This prevents multiple instances of Liquibase from performing schema migrations concurrently. It is accomplished by doing transactional updates to the DATABASECHANGELOGLOCK
table that is added to your schema by Liquibase.
However, this mechanism does not prevent other potential concurrency problems that can result from operations not executed directly by Liquibase. Consider the case where one node in a cluster is performing schema migrations and the other nodes are attempting to perform normal business logic with that schema. Other nodes in the cluster see the schema in stable state A, followed by some amount of intermediate variation, and then finally in stable state B. The application must be designed to handle this sort of transition, or there will need to be downtime while a migration occurs.
Similarly, it is the application's responsibility to handle having a mix of older and newer clients (e.g. during a rolling upgrade) where the concept of the "correct" schema version is not unanimously in agreement, if such an environment is required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With