Why you shouldn't do application-level sharding
Application-level sharding of an OLTP database looks simple on day one (a `shard_for(user_id % N)` function) but accumulates serious engineering burdens as a system grows.
Application-level sharding of an OLTP database looks simple on day one (a `shard_for(user_id % N)` function) but accumulates serious engineering burdens as a system grows.
Yelp moved roughly 1000 Cassandra pods and nearly a petabyte of data from self-managed Kubernetes clusters to Amazon EKS without streaming any data.
Neki, PlanetScale's Postgres sharding system, declares a primary dead only when its control plane (Admin) cannot reach it and at least one reachable replica reports broken replication with none contradicting.
CockroachDB 26.4 introduces skip-level upgrades so operators can move from one annual .4 release to the next without stopping at intermediate releases, and adds active-active writes across two data centers via transactional logical data replication.
Multigres, an open source Postgres cluster manager from the Vitess team, is now in private alpha on Supabase, running Postgres on three nodes across availability zones with automatic failover and built-in connection pooling behind a single connection string.
Sharding Postgres with PgDog let DBOS durable workflow throughput scale linearly from 20K workflows/sec on one db.m7i.4xlarge RDS instance to 1M workflows/sec across 50 shards.
OpenAI's Habitat storage platform went from one shared Azure Cosmos DB container, to per-use-case dedicated containers, and back to a shared multi-tenant container.
Neki's shard groups co-locate related Postgres tables by hashing a shared shard key (e.g. customer_id via xxhash) into a 64-bit keyspace split across shards, so joins and transactions for one customer stay on a single shard with full Postgres semantics.
Neki, PlanetScale's sharded Postgres, implements Postgres sequences by classifying sequence operations like nextval() as router-only, with an authoritative shard hosting all sequences so values are never duplicated across shards.
Neki, PlanetScale's Postgres sharding router, cuts per-query overhead by keeping PostgreSQL wire-protocol bytes intact and decoding only as much as each query requires.
Datadog built Distributed DataFusion, an open source Rust framework that extends Apache DataFusion's physical execution model so a single interactive query can run across many machines while keeping latency roughly flat as data grows.
When a shard key like tenant_id stops matching reality because a few whale tenants dominate load or cross-tenant queries appear, Neki (PlanetScale's sharded Postgres from the Vitess maintainers) offers three escalating fixes: vertically scale the hot shard with its own configuration profile, isolate the whale by narrowing hashed key ranges in the declarative data topology, or reshard specific tables by a better key.
Neki shards unmodified PostgreSQL behind a single connection string.
ZGateway is a stateless regional proxy tier in front of ZippyDB, Meta's most widely used key-value store.
Orbital compute creates a harder problem for stateful systems than for GPUs: data must be replicated, coordinated and placed across a moving constellation.
Cockroach Labs has made its CockroachDB Kubernetes Operator generally available.
Jump Trading runs a self-managed, on-prem ClickHouse cluster of tens of nodes as the system of record for petabyte-scale trading logs, ingesting hundreds of TB per day with peaks of 10M rows/sec and a sub-20-second p99, reconciled daily for zero data loss.
etcd v3.7.0 adds RangeStream, an RPC that returns large range results in chunks so neither server nor client has to buffer the whole response.
LogHouse, ClickHouse Cloud's internal logging platform, has grown to 431 PiB uncompressed (27 PiB on disk) and 1.59 quadrillion rows across 36 cells in 33 geoshards on three clouds, ingesting up to 80 GiB/s and 190M rows/s.
ClickHouse Cloud adds multi-stage distributed query execution, splitting a query plan into stages connected by exchange operators (Gather, Shuffle, Broadcast, Scatter) so intermediate data can be repartitioned between nodes mid-query.
"Multi-region" covers three distinct problems: CDN static asset distribution (level 1), stateless compute in multiple regions with a single-region database (level 2), and multi-region writes for stateful data (level 3).
Neon disabled Postgres full-page writes fleet-wide because its stateless compute streams WAL to a Paxos safekeeper quorum and has no local disk pages that can tear.
Index sharding in ClickHouse Cloud splits primary and secondary index analysis across replicas using consistent hashing over data parts.
Etsy moved shard routing for its ~1,000-table, ~1,000-shard, 425 TB MySQL cluster (1.7M requests/sec) from an ORM that looked up random shard mappings in a single index database to Vitess vindexes, without moving any data.
Sharding Postgres early avoids the operational pain of large single instances, illustrated by an outage where stale planner statistics caused a 300 GB table to be sequentially scanned.
Vinted moved per-user ranking cross-features from Redis into Vespa, then hit p99+ latency spikes above 100 ms after feeding bursts (500M+ updates/hour across 50+ schemas) because data redistribution broke the second-phase document summary fetch (.fill()), causing retries across content nodes.
ClickHouse Cloud's parallel replicas feature spreads a single GROUP BY query across every core of every node in a service, with no pre-aggregation or data reshuffling.
PgDog generates globally unique primary keys across Postgres shards without extensions or external ID services.
Klaviyo replaced a Python-orchestrated segmentation engine built on MySQL and a large Cassandra cluster of pre-aggregated counters with a 192-node on-prem ClickHouse cluster.
Neon shipped a set of storage-layer optimizations across Safekeepers and Pageservers.
ClickHouse Cloud compute nodes are now fully stateless and diskless.
LINE MANGA uses ClickHouse as a federated query layer over its horizontally and vertically sharded MySQL fleet, querying data in place rather than ingesting it.
Cockroach Labs argues that traditional benchmarks like TPC-C, designed in 1992, measure peak throughput in pristine lab conditions and end the test once a power pull disrupts steady state, so they say nothing about behavior during failures, maintenance or recovery.
Squarespace migrated many PostgreSQL databases to CockroachDB without write downtime by streaming changes through a CDC pipeline: pgoutput logical decoding feeds per-table Debezium connectors into Kafka (Avro), and per-table Apache Beam pipelines on Dataflow upsert batched events into CRDB with checkpointing and backpressure.
ClickHouse 25.3 adds query support for AWS Glue and Unity lakehouse catalogs and declares the columnar JSON type, along with the Variant and Dynamic types it is built on, production-ready.
TigerBeetle has added Vortex, a non-deterministic, generative full-system test harness that complements its Deterministic Simulation Testing by exercising real production binaries and client libraries from the outside in.
Husky, Datadog's observability event store layered over object storage, keeps query cost low by controlling fragment count and layout through streaming compaction.
ClickHouse Cloud Warehouses let multiple services, each with its own endpoint, compute nodes, sizing, idling and network access rules, read and write the same data, isolating workloads such as ingestion, BI dashboards and ad-hoc analysis.
A sudden EC2 instance failure took down a Neon pageserver in us-east-1, leaving about 0.4% of projects unable to read uncached pages for 30 minutes to 2 hours.
Slack re-architected its backend and clients to replace the workspace-centric model, where session tokens carried a workspace ID used for shard routing and access control, with an org-wide Unified Grid view for Enterprise Grid customers.
Heroku migrated the time-series store behind MetaaS, its internal metrics service, from self-managed Apache Cassandra to AWS DynamoDB without user-visible impact.
Neon treats Postgres storage as a transaction journal: the write-ahead log becomes the source of truth instead of a recovery aid.
Neon shards its Rust-based Pageserver storage layer by dividing each Postgres relation's 8KiB block numbers into stripes (default 256MiB) and hashing each stripe to a Pageserver.
Figma horizontally sharded its RDS Postgres stack after vertical partitioning ran out of room.
CockroachDB is exercised on a regular cadence of daily, weekly and per-release benchmarks, plus ad hoc and customer-partnered tests, mainly TPC-C, TPC-E and a YCSB-like KV workload.
Shop app outgrew a single MySQL database despite federating tables across databases, so the team moved its Rails backend to Vitess, sharding user-owned tables by user_id into a "users" keyspace and keeping the rest in an unsharded "global" keyspace.
Threads reached 100 million sign-ups in five days on existing shared Meta infrastructure rather than purpose-built systems, illustrated through two components: ZippyDB and Async.
A customer's bulk removal of users triggered Slack's "forget user" async job, which fanned out into a huge number of "leave channel" jobs.
Deno KV's production backend runs on FoundationDB, with a custom "transaction layer" in front of it that handles multi-tenant configuration, JavaScript-native types such as bigint sums, and cross-region replication.
Meta replaced its MySQL semisynchronous replication, whose failover and membership changes were orchestrated by external Python automation, with MySQL Raft, a Raft consensus engine built into mysqld.
ClickHouse 23.3 LTS adds parallel replicas, which let multiple replicas of the same shard each process distinct data ranges assigned by an initiator node.
Neon's storage engine separates Postgres compute from storage and serves pages through GetPage@LSN, reconstructing any page as of any log sequence number from immutable layer files.
Contentsquare replaced 14 Elasticsearch clusters with ClickHouse over a phased migration.
TAOBench is an open-source benchmark that reproduces Meta's social graph workload from TAO, a read-optimized, geo-distributed store serving over 10 billion requests per second on petabytes of data.
Neon replaces Postgres's storage layer with distributed storage, so stateless compute nodes act as Paxos proposers and a fixed set of disk-backed safekeepers act as acceptors.
Data domiciling in a Django app on CockroachDB works by adding a 'cloud' field to a Customers model, deploying the app to Kubernetes clusters in Azure, AWS and GCP, and pinning each row to a region.
Husky is Datadog's third-generation event store, an unbundled, schemaless, vectorized column store that separates compute from storage on top of S3 and a FoundationDB-backed metadata store.
CockroachDB borrows Spanner's TrueTime-inspired approach to ordering distributed transactions but replaces atomic-clock-bounded certainty with a looser uncertainty interval and uncertainty restarts.
ClickHouse 22.1 adds schema inference for table functions like url, s3, file and hdfs, detecting format and compression from the file extension and reading column types from self-describing formats such as Native, Parquet, Avro and ORC.
GitHub split its monolithic `mysql1` MySQL cluster by first virtually partitioning tables into schema domains (declared in YAML) and enforcing boundaries with query and transaction linters, then physically moving domains to new clusters via Vitess vertical sharding or a custom ProxySQL/GTID-based write-cutover script.
Shopify rebalances its MySQL shards by moving individual shops between pods online, with downtime confined to a brief cutover.
RAMP-TAO is a protocol that layers read-atomic transactional guarantees on top of TAO, Facebook's eventually consistent social graph store, so developers get an intuitive read transaction API without handling fractured-read anomalies.
ZippyDB is Facebook's largest strongly consistent, geo-distributed key-value store, built by layering a reusable replication library (Data Shuttle) on RocksDB, Shard Manager and a ZooKeeper-based config service.
Shopify's Rails monolith relies on a set of in-house patterns: the dev CLI for consistent environment setup, a podded architecture that shards the full infrastructure stack by shop, and domain-driven components that share a single database with no database-level foreign keys.
CockroachDB should run in secure mode in production rather than with the --insecure flag, which leaves the cluster open to any client, lets root log in without a password, and sends traffic unencrypted.