Citus and Distributed Postgres
Use Citus to turn Postgres into a distributed database, with co-located tables and reference tables.
What Is Citus?
Citus is a PostgreSQL extension that turns a cluster of PG servers into a distributed database. You SELECT/INSERT against the coordinator; Citus routes to the right worker shards transparently.
Architecture
Two roles:
- Coordinator — receives queries, holds the cluster's metadata, routes/aggregates
- Workers — hold shard data, execute the actual queries
All lessons in this course
- Sharding Strategies: Range, Hash, Directory
- Cross-Shard Queries: The Hard Problem
- Citus and Distributed Postgres
- When NOT to Shard