// the find
citusdata/citus
Distributed PostgreSQL as an extension
Citus is a PostgreSQL extension that shards your database across multiple nodes, turning a single Postgres instance into a distributed cluster. It supports row-based sharding by distribution column, schema-based sharding for multi-tenant apps, columnar storage, and reference tables — all without leaving SQL. Best fit: SaaS apps hitting single-node limits, time-series ingestion at scale, and multi-tenant architectures where each tenant has a clear shard key.
- Stays inside PostgreSQL — no separate query layer, no new wire protocol. Your existing indexes, extensions (PostGIS, HLL), and tools all work because shards are just regular Postgres tables on worker nodes.
- Co-location is the right abstraction for multi-tenant workloads: distribute by tenant_id, co-locate related tables, and cross-table joins for a single tenant never touch the network.
- create_distributed_table_concurrently lets you shard a live table without blocking writes, which is the kind of thing that actually matters when you're migrating production data.
- Schema-based sharding (Citus 12+) is a genuine addition for microservices: route by search_path, no query rewrites, each service owns its schema cleanly.
- Columnar tables don't support UPDATE, DELETE, or foreign keys — so you can't use them for anything that mutates after insert. The workaround (partition + swap old partitions to columnar) adds operational complexity that the docs undersell.
- Cross-shard queries that can't be pushed down to a single node force coordinator-side aggregation or repartition joins, which are expensive and can be surprising. You won't discover this until a query pattern doesn't match your distribution key.
- The coordinator is a single point of failure for schema changes and DDL. Patroni handles HA for data nodes well, but coordinator failover is still operationally fiddly compared to what managed Postgres gives you.
- Running this yourself (non-Azure) means managing Citus version upgrades alongside PostgreSQL major version upgrades — the extension must match the pg version, and the upgrade dance across a multi-node cluster is not simple.