Consider removing support for MySQL
Result
We have agreed to remove support for MySQL at some point. Discussion about when should move to https://gitlab.com/gitlab-org/gitlab-ce/issues/52442
Background
Over the years MySQL has been nothing but a pain in the ass. It's support for modern SQL features is limited, GitLab's internal knowledge of it is limited, and for many new features we need to introduce branches in the code to support both PostgreSQL and MySQL. We should start coming up with a plan to drop support for MySQL entirely, roughly following these steps:
- Start gathering all cases where MySQL is limiting us
- Figure out how many paying customers we have that use MySQL, and how much we earn from this. Having 500 customers use it but pay us €5 wouldn't really be worth the effort of supporting MySQL. On the other hand, 2 customers paying €500 000 is a different story.
- Determine when and for how long we want to deprecate MySQL
- Come up with a plan to migrate the paying customers off MySQL
- Decide which major version will drop MySQL support
Arguments For
Costs of ongoing support
- Slowing down velocity? (note @brodock - can you provide some more detail here?)
- Others?
Places where MySQL already is not supported
- Geo
- Disaster Recover
- Helm Charts
Issues
This is a list of all MRs / features where MySQL was somehow limiting us, with a short summary of the problem. This list should be updated over time as more issues appear:
-
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21499: CI wants to store data as JSON, using PostgreSQL's
jsonb
type to store the data more efficiently. MySQL/Rails has no support for this, requiring either hacks or the use oftext
. - In various MRs we started introducing indexed binary columns, often containing a SHA value. MySQL doesn't support arbitrary length indexes on binary types, so we have to use a hack to index only the first 20 bytes on MySQL
- https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6896: adds a composite index that includes a binary column. This required extending the above hack to support this for MySQL
- Nested groups can not work on MySQL as it doesn't support CTEs, requiring
if mysql?
checks in a variety of places - MySQL requires a variety of hacks to increase limits on various columns, and the right character encoding. Without this, users can run into issues where it refuses to store data. Example: https://gitlab.com/gitlab-org/gitlab-ce/issues/49583
- Cycle analytics uses an almost completely different implementation for MySQL. On PostgreSQL we use CTEs, but on MySQL we use temporary tables (which will not scale at all).
- We cannot leverage PostgreSQL partitioning easily because we cannot use triggers to stay compatible with MySQL https://gitlab.com/gitlab-org/gitlab-ce/issues/51173#note_103352064
Related / Previous discussions
- https://gitlab.com/gitlab-org/gitlab-ce/issues/43252: this talks about dropping PG 9.2 support, but there is also a short discussion on MySQL (https://gitlab.com/gitlab-org/gitlab-ce/issues/43252#note_60352182).