当前位置:网站首页>Database migration tool flyway vs liquibase (II)
Database migration tool flyway vs liquibase (II)
2022-06-24 11:34:00 【Qing Cheng sequent stone】
Keep creating , Accelerate growth ! This is my participation 「 Nuggets day new plan · 6 Yuegengwen challenge 」 Of the 29 God , Click to see the event details
Personal home page :@ green Cheng Foreman stone
I believe there is no need to describe why the use of database migration tools is critical to modern applications that use relational database engines . I just want to say , They can make our life easier , And help us automate complex and repetitive processes . Through this article , I will review the two most common open source migration tools ,Flyway and Liquibase The similarities and differences between them provide some further insights .
Flyway and Liquibase The similarities of
Both are open source to some extent , Some functions are provided for free , But there are also paid versions , More features . And both can use ordinary old SQL To write migration scripts .
Both have strong "Java guide ", Also built-in right Maven or Gradle And other basic building tools , And with the most common Java Integration of framework , for example Spring Boot.
Both can be used as simple shell The list of supported databases that the script runs from the command line is more or less similar . There may be some minor differences in supported versions or drivers , But on the whole , There is no obvious difference between them in this field .
Both are based on the same approach to dealing with database changes , That is, database delivery based on migration . Both tools attempt to implement Martin Fowler Propose and explain the concept of evolutionary database Evolutionary Database Design.
Flyway and Liquibase The difference between
Use across databases
Both of these tools allow you to use pure SQL Write migration scripts in , So as long as you use it , When migrating between different database engines , You have to customize your script . However , You will probably use " magic " Or queries with keywords that exist in a particular engine , This can greatly increase your database performance . If you decide to use Liquibase And write your scripts in other supported formats , You should easily use the same script in different databases .
Variance generation
You can use it. Liquibase Generate diff, but Flyway You can't , Even the paid version . This is also our choice in the project Liquibase instead of Flyway One of the main reasons .
Integrate
As I mentioned in the paragraph describing the similarities , The two tools are almost the same in this respect . There is a very important difference , I want to mention .Flyway There's a local one Java API. It is designed to help us with more complex migrations , such as BLOB and CLOB Or advanced batch data changes . This API It is very useful in some cases , This may be our choice Flyway instead of Liquibase Why .
Roll back
It's time to describe how our tool handles rollback . One side , stay Liquibase In the change log file of , They are relatively easy to set up . in fact , stay changelog Of XML In structure , There is even a special field defined as rollback code . On the other hand , stay Flyway in , It is only available in the paid version . Unfortunately , I have no chance to use it , So I can't make a comprehensive comparison here . If you are willing to pay for your tools , that Flyway This function of is worth trying . However ,Liquibase The paid version of is said to have more sophisticated support for different kinds of rollback , So it's worth checking .
Change order management
The last thing I want to mention and compare is the order in which changes are managed . ad locum , Both tools have a completely different approach .Flyway It is based on the concept of linear database version management . It means , The order in which changes are applied depends on the name of the migration script . in fact ,Flyway The migration script for has a complete naming rule , If you want it to work as expected , You must follow this rule . stay Liquibase in , The order in which changes are applied to our database instance is based on a specific change location in the entire change log file . You can be sure of , If you put your changes in a certain order in the change log , Your changes will be applied to your database in exactly the same order .
summary
I described it Liquibase and Flyway Some similarities and differences between , Try to be impartial and objective . This article should give you a better understanding of how these two tools work and the possibilities they offer . As for the final choice , It is you who make the decision according to the complexity of the data and the system requirements .
If you are not satisfied with both , There are other alternatives , Please refer to the figure below .
juvenile , I didn't see enough. ? Click on the stone Details , Just a little , There might be a surprise ? Welcome to support give the thumbs-up / Focus on / Comment on , Your support is my biggest motivation , Thank you very much !
边栏推荐
- d的10个0符
- Visual presentation of pictures effectively enhances the attraction of large screen
- 链接器 --- Linker
- Internship experience sharing in ByteDance 𞓜 ten thousand word job guide
- Why are some old SEO methods still effective?
- Install Kali on the U disk and persist it
- Oxylabs live online: website capture demo
- Nacos source code - Interface read configuration
- 《梦华录》要大结局了,看超前点映不如先来学学它!
- "Write once, run at all ends", Qualcomm released AI software stack!
猜你喜欢

Use the process monitor tool to monitor process operations on registries and files

GLOG从入门到入门

脚本之美│VBS 入门交互实战

如何开发短信通知和语音功能医院信息系统(HIS系统)

Turn 2D photos into 3D models to see NVIDIA's new AI "magic"!

math_ Summation and derivation of proportional series & derivation of sum and difference of equal powers / difference between two nth power numbers/
[Architect (Part 41)] installation of server development and connection to redis database

Programmers spend most of their time not writing code, but...

Libuv的安装及运行使用

How to develop hospital information system (his) with SMS notification and voice function
随机推荐
PHP SMS notification + voice broadcast automatic double call
ahk实现闹钟
【Go语言刷题篇】Go从0到入门4:切片的高级用法、初级复习与Map入门学习
Reliable remote code execution (1)
TP-LINK 1208路由器教程(2)
《opencv学习笔记》-- CV::Mat类
Adobe Photoshop using the box selection tool for selection tutorial
Centripetalnet: more reasonable corner matching, improved cornernet | CVPR 2020 in many aspects
把腾讯搬到云上,治愈了他们的技术焦虑
Basic path test of software test on the function of the previous day
PF_ Ring ZC | high speed traffic processing dpdk alternative
Turn 2D photos into 3D models to see NVIDIA's new AI "magic"!
GTest从入门到入门
Investing in a good navigation framework from the beginning of the jetpack compose tutorial will help you save a lot of migration work later
计组_cpu的结构和工作流程
历史上的今天:图灵诞生日;互联网奠基人出生;Reddit 上线
美团基于 Flink 的实时数仓平台建设新进展
Realization of alarm clock with AHK
Disaster recovery series (II) -- enterprises' one-stop disaster recovery construction with the help of cloud platform?
Tke deployment kubord