Vivek Jalondhara. All writing

Databases

TimescaleDB and Citus: Scaling Time-Series and Multi-Tenant Data

By Vivek Jalondhara · 1 min read
Published Jan 2026 · Updated

Two Postgres extensions that let you scale without abandoning the database you already trust.

For activity tracking and audit logs, increasing write volume can make partitioning worth evaluating. TimescaleDB's hypertables partition time-series data transparently, keeping inserts fast and time-range queries cheap — all while staying Postgres underneath.

Citus solves a different axis: horizontal scale and multi-tenancy. Distributing by tenant ID keeps each tenant's data co-located and queries parallelized across nodes, which is exactly what a growing SaaS needs.

The beauty of both is continuity. Your SQL, your tooling, and your mental model stay the same — you're scaling the database you already know rather than learning a new one.

Measure the audit-log access pattern first

Before selecting a time-series or sharding extension, inspect the queries that need help. A CRM audit view commonly filters by tenant and time; that is the workload to test.

Illustrative example · SQL · Simplified for explanation

EXPLAIN (ANALYZE, BUFFERS)
SELECT action, occurred_at
FROM audit_events
WHERE tenant_id = $1
  AND occurred_at >= $2
  AND occurred_at < $3
ORDER BY occurred_at DESC
LIMIT 100;
How the example fits together
  1. Capture workload
  2. Inspect query plan
  3. Try indexes or partitioning
  4. Evaluate extensions

Conceptual flow for the example above.

Tradeoff to keep in mind

Extensions introduce operational constraints and do not automatically improve every query. Benchmark representative data and include write and maintenance costs.

Related project: SmackDab CRM →

Related posts