Bytebase vs. Flyway: a side-by-side comparison for database schema migration
If Flyway is Git, then Bytebase is GitHub/GitLab.
When looking for a database CI/CD and schema migration change tool, Bytebase and flyway are two common options. Understanding the differences between these two tools can help potential users choose the one that best meets their needs.
What Bytebase and Flyway have in common
- Native SQL supported.
- Database DevOps with version control system #GitOps (see Database GitOps configuration).
- Schema Synchronization (see Sync schema).
- Tiered pricing, offering both free and paid plan.
- Open source, Flyway has a long history, while Bytebase is growing faster.
What are the differences between Bytebase and Flyway?
While both Bytebase and Flyway are tools for database DevOps, there are some key differences between the two. Flyway main product is its CLI and the java library. Bytebase also provides a CLI, while its main product is the GUI-based workspace for developers and DBAs to collaborate.
Flyway | Bytebase | |
---|---|---|
Product position | Schema change | Schema Change, Data Query and Secure |
Developer interface | CLI | GUI, API |
Supported databases | 22 Only SQL DB | 22 SQL & NoSQL DB |
Programming language and installation | Java + JVM | Golang and no other dependency |
Change execution | SQL script + CLI | Issue, GUI |
Database GitOps | β | β |
Change history | β | β |
Sync schema | β | β |
SQL auto check | β οΈ Paid version | β Available in Free version |
Rollback | β οΈ Manual | β Auto generated rollback statement |
Schema drift detection | β οΈ Manual | β Auto |
Approval flow | - | β |
Batch Change | - | β Multi-environment / Multi-tenant |
Slow query detection and advisor | - | β |
Data access control, data masking, security and compliance | - | β |
Webhook | - | β |
Product position
-
Flyway: A database schema change and version control tool.
-
Bytebase: In addition to database schema change and version control, Bytebase also provides data query, security, and governance features. It provides a GUI based collaboration workspace that helps DBAs and Developers manage the database development lifecycle.
Developer interface
- Flyway: A command-line tool. With JVM, it also provides Java API, Maven plugin and Gradle plugin. A simple graphical user interface (GUI) called Flyway Desktop is available for SQL Server, PostgreSQL and MySQL.
- Bytebase: A web-based GUI tool. It also provides application programming interface (API), Terraform Provider, and GitHub App.
Supported databases
- Flyway: 22 SQL databases - MySQL, PostgreSQL, IBM DB2, MS SQL Server, Oracle, PostgreSQL, MySQL, Snowflake ...
- Bytebase: 22 SQL and NoSQL databases - MySQL, PostgreSQL, Oracle, MS SQL Server, ClickHouse, MongoDB, Redis, Redshift, Snowflake, ...
Installation
- Flyway: Java-based tool, so you need to install a Java Virtual Machine (JVM) before users can install Flyway.
- Bytebase: Go-based tool, a self-contained binary with no external dependency. Also provides Docker and Kubernetes deployment.
Change execution
- Flyway: CLI or GitOps. Users write SQL files and then run command
flyway migrate
.
-
Bytebase: Web-based GUI or GitOps. Users create issues with SQL which could be approved. An issue may include SQL running against one database, or batch change against multiple databases span across different development environments and different tenants.
Users can create tenant project to facilitate batch change. In tenant mode, users can do advanced canary release.
Users can also do online schema change for large tables to reduce downtime from hours to seconds.
Database GitOps configuration
-
Flyway: Configure with VCS CI/CD workflow manually.
-
Bytebase: Point-and-Click GitOps workflow setup.
You may even enable SQL Review in GitLab automatically by clicking a checkbox while configuring GitOps workflow. (which is not in the video)
Check the video: Setting up GitLab VCS integration for Bytebase (GitOps)
Because Bytebase has the similar project concept as seen in GitLab/GitHub, the GitOps integration is nature to the developers.
Change history
-
Flyway: Run
flyway info
to show a simple history table. -
Bytebase: Change History tracking diffs and the originated issue.
Sync schema
-
Flyway: Via the flyway desktop, there is a way to generate a migration script to bring the target database schema in sync with the one you already created (usually dev).
-
Bytebase: Choose a specific schema version, auto calculate the diff with selected databases.
SQL auto check
SQL auto check helps developers write less buggy SQL and save DBAs manual review efforts.
- Flyway: Code Analysis
- Bytebase: SQL Review
Supported Plan
- Flyway: Only in Team Plan or above
- Bytebase: Available in Free Plan
Number of rules
- Flyway: 10+ general rules or integrate a python app called SQLFluff to get more rules.
- Bytebase: 49 rules for MySQL, 38 rules for PostgreSQL, 18 rules for Oracle ...
How to configure
- Flyway: Predefined, users may set them active or not.
- Bytebase: Rules are predefined, users can activate and choose error level for specific rules. The picked rule set will make a reusable policy which can be applied to environment, e.g.
Test
,Staging
,Prod
.
How to trigger
-
Flyway: Run
flyway check -code ....
command to produce a report. -
Bytebase: Three places to trigger SQL review by default, users may manually integrate it to other scenarios by API as well:
-
When a database change is created as an issue.
-
When users query data from SQL Editor.
-
When users enable GitOps workflow, before a new SQL is merged into the main branch.
-
Rollback
- Flyway: Write rollback scripts manually. Supported in Team version or above.
- Bytebase: By using sync schema, users may revert to a specific version. Also support auto rollback. For Free version, users can revert to the latest version, while for Pro version or above, users can choose any version.
Schema drift detection
- Flyway: Run
flyway check -drift ...
to produce a report indicating difference between target database and the one created by the migrations applied by Flyway. - Bytebase: Will auto detect schema diff if someone manipulates the schemas out of Bytebase.
Approval flow
- Flyway: Not supported.
- Bytebase: Basic rollout and risk-based custom approval flow.
Slow query detection and advisor
- Flyway: Not supported.
- Bytebase: Will auto detect slow queries and send weekly summary report. Provide an AI-based index advisor to provide query optimization advice.
Data access control, data masking, security and compliance
-
Flyway: Not supported.
-
Bytebase: With centralized SQL Editor, data access is controlled, reviewed, audit-logged. Also provide data masking, watermark.
Bytebase supports RBAC, e.g. developers need to require permission to access or export databases via SQL Editor.
Everything that happened within Bytebase will be recorded for audit purposes.
Bytebase also supports SSO.
Webhook
-
Flyway: Not supported.
-
Bytebase: IM webhook.
Summary
To summarize, Bytebase and Flyway are both viable options for database CI/CD. Flyway deliver its feature via its CLI, while Bytebase offers a GUI-based collaboration space.
As an analogy, Flyway is Git for database, and Bytebase is GitHub/GitLab for database. Git is good for local and personal use. On the other hand, for team development which needs collaboration, review, access control and etc, GitHub/GitLab is more suitable.
Related comparisons: