4 Hours
19. Distributed SQL with Citus
Architecture
Scaling Beyond a Single Machine
Eventually, you will hit a wall where the world's largest server isn't big enough for your data. This is where Sharding becomes necessary. While standard Postgres is single-node, extensions like Citus transform it into a distributed database.
How Sharding Works
Sharding splits your massive table across multiple physical servers. A Coordinator node manages the metadata and routes your queries to the correct Worker nodes.
Distributed Tables
A single table that is physically spread across 10+ servers. Queries run in parallel.
Reference Tables
Small tables (like Countries) that are copied to every server for fast local joins.
Knowledge Check
Ready to test your understanding of 19. Distributed SQL with Citus?