
Scaling PostgreSQL to power 800 million ChatGPT users
By Bohan Zhang, Member of the Technical Staff
PlanetScale describes distributing a Postgres database across 768 servers (256 shards, each with a primary and two replicas) to store and query a petabyte of data.
A proxy router layer sits between app servers and the shard cluster, using a sharding strategy such as hashing an ID column to direct each query to the correct shard. Neki for Postgres and Vitess for MySQL present the distributed cluster to applications as a single connection string.