flâneur

The lifecycle of a sharded Postgres query — PlanetScale

planetscale.com · 5,743 words · saved by 1 readers

Follow a SQL query through the router, across four Postgres shards, and back.

If you’ve ever used Postgres and thought, “wow, this is such a simple piece of software, I understand every part of it perfectly,” you have not yet met the query planner. Now consider sharding that database across a thousand servers. How would you serve a query? All you'd need is a system that replicates the Postgres auth system, wire protocol, and parser, plus a shard-aware distributed query planner, graceful handling of all server failure scenarios, and connection pooling that overcomes the Postgres process-per-connection architecture. Easy, right? Let's follow the journey of a Postgres…

saved by

related reading