Back to feed
Dev.to
Dev.to
7/9/2026
The original title is "Postgres vs ClickHouse? I use both. 4 tricks from the split."

The original title is "Postgres vs ClickHouse? I use both. 4 tricks from the split."

Original: Postgres vs ClickHouse? I use both. 4 tricks from the split.

Short summary

The author splits their uptime monitor's data between Postgres (config, incidents, teams — rows that change) and ClickHouse (check results — append-only, never updated). The one rule: if a row ever changes, it goes to Postgres; if it's written once and never touched, it goes to ClickHouse. Four concrete tricks cover codec selection (DoubleDelta for steady-interval timestamps, T64 for durations), LowCardinality types, sort keys, and per-row TTLs that make billions of rows cheap.

  • Split data by write pattern, not by engine speed: mutable rows → Postgres, append-only → ClickHouse
  • ClickHouse codecs like DoubleDelta and T64 compress steady-interval time-series data to near-zero per row
  • Constraints and transactions in Postgres protect small mutable datasets; column-store compression handles the firehose

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more