Can CockroachDB and YugabyteDB Run GitLab? A Comprehensive Compatibility Test
This article evaluates whether the distributed databases CockroachDB and YugabyteDB can replace PostgreSQL as the backend for GitLab, detailing the test environment, migration steps, functional checks across core GitLab features, observed errors, and a final comparison of compatibility and stability.
Test Background
GitLab switched to PostgreSQL‑only support from version 12.1.0, prompting the need for a unified, scalable, and highly available GitLab deployment across multiple business units. The study investigates whether the PG‑compatible distributed databases CockroachDB and YugabyteDB can host GitLab and support its core functions.
Test Environment
CockroachDB
defaultdb=# SELECT version();
CockroachDB CCL v22.1.0 (x86_64-pc-linux-gnu, built 2022/05/23 16:27:47, go1.17.6)
(1 row)YugabyteDB
gitlab=# SELECT version();
PostgreSQL 11.2-YB-2.13.2.0-b0 on x86_64-pc-linux-gnu, compiled by clang version 12.0.1 (https://github.com/yugabyte/llvm-project.git bdb147e675d8c87cee72cc1f87c4b82855977d94), 64-bit
(1 row)GitLab
GitLab information
Version: 12.1.0-ee
Revision: 1f2e6f3f6d8
Directory: /home/git/gitlab
DB Adapter: PostgreSQLTest Scenarios
The following GitLab features were exercised after migrating a standard GitLab database to each target DB:
Project List
Project View
Repository View
Branch List
Issue List
Merge Request List
Merge Request View
New Project
Create Branch
Create Issue
Create Merge Request
PR Merge
Add Project Member
Test Process
1. Export schema and data from PostgreSQL
pg_dump --host 10.3.70.132 --port 32298 --user postgres --no-owner -W gitlabhq_production > /root/gitlabhq_production.sql2. Import into CockroachDB
psql --host 10.3.70.189 --port 26258 --user root gitlab -f /root/gitlabhq_production.sql > pg_import_crdb.logDuring import, CockroachDB reported two types of errors:
ERROR: at or near "pg_trgm": syntax error: unimplemented: this syntax
ERROR: at or near ".": syntax error: unimplemented: this syntaxThese errors relate to unsupported extensions (pg_trgm) and operator classes. After ignoring them, the object count was:
relkind | count
--------+------
r | 249
i | 890
S | 231
(3 rows)The database was then linked to GitLab, the configuration reloaded, and GitLab restarted:
sudo -u git -H editor config/database.yml
sudo /etc/init.d/gitlab restartGitLab started successfully and the login page loaded without errors.
3. Import into YugabyteDB
psql --host 10.3.70.189 --port 5434 --user postgres gitlab -f /root/gitlabhq_production.sql > pg_import_ygdb.logImport completed without errors. Object count after import:
relkind | count
--------+------
r | 249
i | 903
S | 231
(3 rows)GitLab was pointed to this database, restarted, and all core UI pages (login, project list, issue list, merge request view, etc.) displayed correctly.
Results
For each scenario the outcome was recorded. The most relevant observations are summarized below.
CockroachDB
Project List, Project View, Repository View, Branch List, Issue List, Merge Request List, Merge Request View, New Project, Create Branch, Create Issue, Create Merge Request, Add Project Member – all functioned correctly.
Failed scenarios: New Project (500 error, missing column "namespaces.rowid"), GitLab Import (cannot reach the import page), PR Merge (merge request stuck in loading, eventually error).
YugabyteDB
All scenarios succeeded except PR Merge , which exhibited the same loading‑then‑error behavior as CockroachDB.
Conclusion
YugabyteDB demonstrated better overall compatibility with GitLab, with only the PR‑merge operation failing. CockroachDB failed three core operations, indicating more gaps in PostgreSQL feature support. The PR‑merge issue may be unrelated to the database layer and warrants further investigation.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
dbaplus Community
Enterprise-level professional community for Database, BigData, and AIOps. Daily original articles, weekly online tech talks, monthly offline salons, and quarterly XCOPS&DAMS conferences—delivered by industry experts.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
