当前位置:网站首页>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 !
边栏推荐
- Turn 2D photos into 3D models to see NVIDIA's new AI "magic"!
- 【老卫搞机】090期:键盘?主机?全功能键盘主机!
- SwiftUI Swift 内功之 Swift 中的属性观察者 didSet 与 willSet
- 8 types of API automated testing that technicians must know
- [the lottery in May has ended, and the list of winners has been announced] special session of techo youth university open course database
- Using the collaboration database query of Poole in laravel5.6
- Insurance app aging service evaluation analysis 2022 issue 06
- “一次编写,运行各端”,高通重磅发布 AI 软件栈!
- Anonymous Messenger: hidden communication of Trojan horse
- [206] use PHP language to generate the code of go language
猜你喜欢

Any 与 TypeVar,让 IDE 的自动补全更好用

Install Kali on the U disk and persist it

"Write once, run at all ends", Qualcomm released AI software stack!

Understanding of homogeneous coordinates

软件测试 对前一日函数的基本路径测试

Beauty of script │ VBS introduction interactive practice

链接器 --- Linker

【Go语言刷题篇】Go从0到入门4:切片的高级用法、初级复习与Map入门学习

TP-LINK 1208路由器教程(2)

"One good programmer is worth five ordinary programmers!"
随机推荐
Any 与 TypeVar,让 IDE 的自动补全更好用
[digital ic/fpga] booth multiplier
How to export only the titles in word documents? (i.e. delete all the text contents and keep only the title) stop B
I want 18K. Can I pass it?
如何开发短信通知和语音功能医院信息系统(HIS系统)
Axi low power interface
【直播回顾】战码先锋第七期:三方应用开发者如何为开源做贡献
[deep learning][pytorch][original]crnn trains loss on the higher version of pytorch as a solution for Nan
Which is a good CAD drawing software? How to select good software
8 types of API automated testing that technicians must know
Google ranging for PHP wechat development
美团基于 Flink 的实时数仓平台建设新进展
2D 照片变身 3D 模型,来看英伟达的 AI 新“魔法”!
qt -- QTabWidget 中支持拖拽TabBar项
【云驻共创】解读HarmonyOS 应用与服务生态
把騰訊搬到雲上,治愈了他們的技術焦慮
u盘安装kali并且持久化
It's so difficult for me. Have you met these interview questions?
[Flink source code practice (I)] add a rest API to Flink
“一个优秀程序员可抵五个普通程序员!”