Citus use cases

While Citus is a distributed database, it is not intended to be used for any and all use cases. Rather, Citus has very specific use cases that are a fit. Before you get started with Citus, we strongly recommend examining whether or not your specific use case is a good fit for Citus.

If you have questions about Citus or want to discuss whether Citus may be a good fit for you, please open a support ticket or contact your Crunchy account representative.

Multi-tenant applications & co-location

Applications that are multi-tenant (often SaaS and B2B style applications) are typically a good fit for Citus because they have a natural sharding key (customer id, tenant id, org id). Because a tenant's data only belongs to that specific tenant, data can easily be co-located.

Real time analytics (HTAP)

Real-time analytics applications, sometimes referred to as hybrid transactional and analytical processing workloads, can often be a good fit for Citus. These applications often have to ingest lots of raw data which can be handled with multi-row inserts or micro-batching with Postgres copy mechanism. Citus parallelizes data ingestion for throughput of over 1M records per second. Citus then allows for rollups, aggregations, and parallelization for canned reports and dashboards.

Time series

In addition to horizontal scaling, Citus has great support for partitioning with pg_partman and compression with Citus columnar access method. This is a common approach for IOT use cases and sensors where you shard by a device ID and then do your partitioning on timestamp. Using this approach, you can automatically convert data after a certain period of time to columnar for longer retention.

When not to use Citus?

As we mentioned in the opening, Citus is not a fit for all use cases. Here are a few use cases that are commonly associated with Citus, but are in fact not good fits:

  • Data warehousing and ad-hoc analytics
  • Geo distributed workloads
  • B2C apps