finds.dev

citusdata/citus

Distributed PostgreSQL as an extension

View on GitHubHomepage ↗

★ 12,560CAGPL-3.0updated Jun 2026

// the take

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.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
12,560
Forks
779
Language
C
License
AGPL-3.0
Last commit
14 Jun 2026

// nearby

If citus isn't quite it.

All repos →