当前位置:网站首页>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 !
边栏推荐
- 2D 照片变身 3D 模型,来看英伟达的 AI 新“魔法”!
- Go basic series | 4 Environment construction (Supplement) - gomod doubts
- Jenkins remote publishing products
- Internship experience sharing in ByteDance 𞓜 ten thousand word job guide
- Concise tutorial | making cartoon heat map with PPT - EFP graph?!
- How to open a video number?
- Centripetalnet: more reasonable corner matching, improved cornernet | CVPR 2020 in many aspects
- Axi low power interface
- "One good programmer is worth five ordinary programmers!"
- Ppt drawing related, shortcut keys, aesthetics
猜你喜欢

【毕业季·进击的技术er】绕树三匝,何枝可依?

Shell脚本(.sh文件)如何执行完毕之后不自动关闭、闪退?

u盘安装kali并且持久化

计组_cpu的结构和工作流程

我真傻,招了一堆只会“谷歌”的程序员!

ArrayList#subList这四个坑,一不小心就中招

万名校园开发者花式玩AI,亮点看这张图就够啦!

"Meng Hua Lu" is about to have a grand finale. It's better to learn it first than to look ahead!

“一次编写,运行各端”,高通重磅发布 AI 软件栈!

Beauty of script │ VBS introduction interactive practice
随机推荐
如何只导出word文档中的标题?(即将正文内容都删除,只保留标题)B站牛逼
Understanding of homogeneous coordinates
How does wechat and QQ chat work? So simple!!!
图片的可视化呈现有效增强大屏吸引力
GLOG从入门到入门
RPM installation percona5.7.34
Google Earth Engine(GEE)—如何新增一个图例在Map面板
"Adobe international certification" Adobe Photoshop adjusts cropping, rotation and canvas size
Use the process monitor tool to monitor process operations on registries and files
【毕业季·进击的技术er】绕树三匝,何枝可依?
Google ranging for PHP wechat development
Reading at night -- about microservices and containers
Cook a delicious cli
[technical tutorial] national standard protocol platform easygbs cascading supports customized national standard channels
Oxylabs live online: website capture demo
Self cleaning Manual of mining Trojan horse
@Requestbody annotation
Programmers spend most of their time not writing code, but...
I just did it! Visualization of character relationships in Douluo continent
Insurance app aging service evaluation analysis 2022 issue 06