Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why and when Liquibase?

I have searched for this answer on stack overflow, but I couldn't find any questions on this. I am new to Liquibase and want to learn

  • Why Liquibase?
  • When exactly one should use Liquibase in the project?

I know that this is to keep all database changes in one place but the similar can be done by creating a simple SQL files in some repository system and keep updating it with time.

like image 608
SSC Avatar asked Apr 21 '15 00:04

SSC


People also ask

Why we should use Liquibase?

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.

What is the difference between Liquibase and flyway?

Defining a Change. Flyway uses SQL for defining a change. On the other hand, Liquibase provides flexibility to specify a change in different formats including SQL such as XML, YAML, and JSON. With Liquibase we can work with database-agnostic languages and easily apply schema changes to different database types.

Is Liquibase an ORM?

Hibernate and Liquibase are primarily classified as "Object Relational Mapper (ORM)" and "Database" tools respectively.


1 Answers

The key differentiator between a self-managed schema create file and Liquibase (or other schema migration tools) is that the latter provides a schema changelog. This is a record of the schema changes over time. It allows the database designer to specify changes in schema & enables programmatic upgrade or downgrade of the schema on demand.

There are other benefits, such as:

  • Database vendor independence (this is questionable, but they try)
  • automated documentation
  • database schema diffs

One alternative tool is flyway.

You would choose to use a schema migration tool when you want or need to automatically manage schema updates without losing data. That is, you expect the schema to change after your system has been deployed to a long-lived environment such as a customer site or stable test environment.

like image 72
Synesso Avatar answered Oct 21 '22 09:10

Synesso