Postgres Sharding: A Thrilling Tale of Scaling to 6x
2025-03-14

A company faced a challenge with PostgreSQL's write capacity, handling 100,000 users/second. Instead of migrating to NoSQL, the engineering team chose to shard their database. They split the database into 6 instances, syncing data with logical replication. This involved writing Ruby and Python code to handle sharding keys and custom tools to address sequence issues. The successful 6x expansion resulted in the creation of PgDog, an open-source project for automated Postgres sharding. This story highlights the ingenuity and determination of engineers, and the scalability of PostgreSQL.
Development
database sharding