Read replicas vs sharding: how far replicas got OpenAI, and when teams sharded

Published 2026-10-19 · Built only from first-party engineering write-ups in our database. Every number below comes from the linked source.

OpenAI is the strongest case for going far with replicas: ChatGPT runs on a single-primary Postgres with nearly 50 global read replicas, while write-heavy shardable workloads moved to Cosmos DB. Replicas scale reads, not writes, so the teams here whose writes outgrew one primary sharded instead: Figma, Notion, Slack and Shopify.

Read replicas vs Sharding: side by side

Read replicasSharding
Stories in our database66
CompaniesFigma, GitHub, GitLab, OpenAI and ShopifyFigma, Notion, PlanetScale, Shopify and Slack
Published2021–20262020–2026
Stack in these storiesPostgreSQL (3), Azure (2), Azure Blob Storage (2), Git (2)MySQL (3), PostgreSQL (3), Vitess (3), AWS RDS (2)
Scale numbers stated in sources99.99999% of repositories copied to Azure (GitHub); 473.3 billion Git events/month (GitHub); 800 million users (OpenAI)118.5M QPS sustained for 16 minutes (PlanetScale); 1 million QPS (PlanetScale); 2.3 million QPS (Slack)
Direct comparison storyOpenAI: Scaling PostgreSQL to power 800 million ChatGPT users(same story)

Verdict

Add replicas while reads are the bottleneck, and plan for replica consistency (Shopify) and replica stalls (GitLab). Shard, or move workloads out, when writes outgrow one primary.

Counts are stories in How They Scaled tagged with each side, see the read replicas and horizontal sharding pages. They describe what these teams wrote about, not market share or benchmark results.

The direct comparison

Read replicas in other scaling stories

GitHub · 2026

The bridge to agent-scale Git infrastructure

GitHub has copied 99.99999% of its Git repositories to Azure, where most now keep two of their five replicas and Azure serves about half of Git traffic. The busiest remaining repositories were blocked by a ~25ms cross-region round trip, because Spokes held a repository-wide lock for each write while waiting on the slowest healthy replica. Scoping the quorum to individual Git references lets writes to different branches proceed in parallel (3-4x higher throughput in internal testing), and a virtual write replica that streams writes into Azure Blob Storage lets stateless read replicas scale out on demand.

99.99999% of repositories copied to AzureAzure serves about half of Git trafficper-reference quorumstorage/compute separationcloud migrationGitSpokesAzure
GitHub · 2026

Building Git infrastructure for agent-scale development

GitHub explains why agent workloads strain Spokes, which keeps five durable copies of each repo on fileserver disks, so every added read replica slows writes. The new design coordinates only the ref update, moves compaction and GC to separate workers, and separates storage from compute: Azure Blob Storage holds the authoritative data while lightweight caching workers serve reads.

473.3 billion Git events/month7.38 billion commits in Sept 2026control plane separationread replicascachingGitSpokesAzure Blob Storage
Figma · 2023

The growing pains of database architecture

How Figma moved from one Postgres instance to multiple databases by vertically partitioning table groups.

vertical partitioningread replicasconnection poolingPostgreSQLAWS RDS
GitLab · 2021

Why we spent the last month eliminating PostgreSQL subtransactions

GitLab traced replica stalls to Postgres subtransaction overflow and removed subtransactions from its code.

query optimizationread replicasPostgreSQLRuby on Rails
Shopify · 2021

Read Consistency with Database Replicas

Shopify routes reads to MySQL replicas while giving apps consistency guarantees such as monotonic reads.

read replicasconsistencyMySQL

Sharding in other scaling stories

PlanetScale · 2026

118 million queries per second on Neki

PlanetScale benchmarked Neki, its sharded Postgres, with single-shard primary-key point selects. Targeting about 200K QPS per shard, it went from 5 shards (about 1M QPS) to 50 (9.9M QPS, per-shard rate within 0.8%) to 512 shards and 480 routers, sustaining 118.5M QPS for 16 minutes over 1.22 PiB with a p99 of 6.06 ms at the router and about one error per 1.8 million queries. PlanetScale notes the run was read-only, primary-only with no replicas, and had no failover during the measured window.

118.5M QPS sustained for 16 minutes512 shards, 480 routershorizontal shardingbenchmarkinglinear scalabilityPostgreSQLNekiAWS r8g.16xlarge
Figma · 2024

How Figma's Databases Team Lived to Tell the Scale

Figma's nine-month effort to horizontally shard its Postgres stack using a custom query proxy and logical sharding before physical splits.

horizontal shardingquery proxyonline migrationPostgreSQLAWS RDS
Shopify · 2024

Horizontally scaling the Rails backend of Shop app with Vitess

Shopify's Shop app adopted Vitess to shard its Rails backend, covering keyspace design and the migration plan.

horizontal shardingdatabase migrationMySQLVitessRuby on Rails
PlanetScale · 2022

One million queries per second with MySQL

PlanetScale benchmarked a horizontally sharded Vitess cluster up to one million QPS.

1 million QPShorizontal shardingbenchmarkingMySQLVitess
Notion · 2021

Herding elephants: Lessons learned from sharding Postgres at Notion

Notion split its Postgres monolith into a fleet of logical shards keyed by workspace, using double-writes and backfills to migrate.

horizontal shardingonline migrationdouble writesPostgreSQLAWS RDS
Slack · 2020

Scaling Datastores at Slack with Vitess

Slack's multi-year migration from active-active MySQL pairs to Vitess, so data could be sharded by any key, not only workspace.

2.3 million QPShorizontal shardingdatabase migrationMySQLVitess

FAQ

How many read replicas does OpenAI use?

OpenAI's post says ChatGPT runs on a single-primary Postgres with nearly 50 global read replicas.

What problems do read replicas cause?

Shopify's post covers giving apps consistency guarantees, such as monotonic reads, when reading from MySQL replicas. GitLab traced replica stalls to Postgres subtransaction overflow.

The best scaling write-ups, weekly

One email a week. No spam.

Subscribe

More comparisons

All comparisons →