Citus turns PostgreSQL into a distributed database by sharding tables across nodes. It adds a distributed query engine, reference tables, and optional columnar storage while staying a Postgres extension.
Overview
Citus is a PostgreSQL extension that distributes data and queries across a cluster of Postgres nodes. Distributed tables are sharded so CPU, memory, storage, and I/O can scale together, while reference tables can be replicated to every node for joins and foreign keys that do not use the shard key.
A distributed query engine routes and parallelizes SELECT, DML, and related operations. Columnar storage compresses data and speeds scans on supported tables. You can start on a single node with Citus enabled and later add workers and rebalance shards as load grows. Schema-based sharding treats each schema as a logical shard, which the docs position for multi-tenant apps and microservices with minimal query changes.
Citus is not a fork of Postgres; it works with current PostgreSQL versions and familiar tools. Setup paths include managed Elastic Clusters on Azure, a single Docker container for trials, local package installs on Linux distributions, and multi-node clusters documented for several operating systems. Common workloads called out include multi-tenant SaaS, customer-facing real-time analytics, and mixed transactional and analytical use on one database.
Key features
- Transparent table sharding
- Replicated reference tables
- Distributed query parallelization
- Columnar table storage
- Schema-based tenant sharding
- Concurrent table distribution
- Co-located distributed joins
- Shard rebalance when adding nodes
Use cases
- Multi-tenant SaaS databases
- Real-time analytics dashboards
- Microservices with per-service schemas
- Postgres scaling beyond one node
- Mixed transactional and analytical SQL