GitLab architecture: how GitLab scaled (3 case studies)
GitLab.com runs on PostgreSQL with Ruby on Rails. GitLab split its CI tables into their own Postgres database to relieve the main database, and traced replica stalls to Postgres subtransaction overflow, then removed subtransactions from its code.
We track 3 public engineering write-ups by GitLab, published between 2021 and 2026. They cover agent-native interfaces, decomposition, partial fetch and query optimization. Stack mentioned most: PostgreSQL (2) and Ruby on Rails (2). 1 of the 3 state concrete scale numbers, for example "single agent invocation can need 5-10 GB of transfer and 30+ s of setup". Each card below links to our short summary and the original post.
Both GitLab posts are about the Postgres database behind its Ruby on Rails app. Compare them with Rails scalability stories from GitHub and Shopify.
Tech used in GitLab's scaling write-ups
GitLab scaling timeline: every story, summarized
- 2021-09-29
Why we spent the last month eliminating PostgreSQL subtransactions
GitLab traced replica stalls to Postgres subtransaction overflow and removed subtransactions from its code.
- 2022-06-02
We are splitting our database into Main and CI
GitLab.com split CI tables into their own Postgres database to relieve its main database.
- 2026-10-13
Scaling Git for the agentic software factory
GitLab is building next-gen source control for thousands of concurrent AI agents working on large repositories. With conventional Git, a single agent invocation can mean 5 to 10 GB of data transfer and more than 30 seconds of setup just to answer one question. Next-gen SCM keeps the Git protocol but runs stateless compute that scales horizontally against shared object storage, including S3-compatible storage customers control, and lets agents request only the files and history they need instead of cloning whole repos. In early internal tests, workloads ran up to 50x faster with up to 1,000x less network traffic, which GitLab calls peak results it is still validating. It also notes CI is the next bottleneck: GitLab.com customers created 40% more pipelines and pushed 50% more code over the past year.
FAQ
What database does GitLab use?
PostgreSQL, in both GitLab posts we track. In 2022 GitLab.com split CI tables out of its main Postgres database into a separate CI database.
Why did GitLab eliminate PostgreSQL subtransactions?
GitLab's 2021 post traced stalls on its read replicas to Postgres subtransaction overflow, and the fix was removing subtransactions from its code.