Skip to content
← Blog
clickhouse vs postgrespostgres time seriestimescaledbtelemetry databaseiot

Postgres or ClickHouse for Equipment and Sensor Telemetry (and When to Run Both)

Brice Ayres /

Short answer

Keep the application — units, customers, contracts, current state — on Postgres. When tracker and sensor readings start to crowd that database, don't automatically abandon it. Try partitioned Postgres, or TimescaleDB, while the volume is still something Postgres can hold. When ingest, retention and fleet-wide analytical queries are the job, move the readings to ClickHouse and replicate them from Postgres or from the ingest pipeline. ClickHouse's Managed Postgres went generally available on November 9, with an announced Xata acquisition for branching and serverless workflows still being integrated. The useful design is still two workloads, often two engines, without downtime for the app.

A dark office desk at night with two monitors, one showing an amber time-series chart and the other a grey schema of connected boxes, with a keyboard and mug in the foreground

Keep the application on Postgres. Units, customers, contracts, work orders and the current state of a generator, tank or trailer belong in a transactional database. When tracker and sensor readings start to outgrow one Postgres box — storage climbs, vacuums fight ingest, and fleet-wide analytical queries get in the way of the app — you have three honest options: partition what you have, add a time-series extension such as TimescaleDB, or move the readings to ClickHouse and leave Postgres as the system of record.

We run that last pattern ourselves for heavy time series: Postgres for the operational data, ClickHouse for the high-volume readings. The November 9 news, ClickHouse Managed Postgres going generally available and ClickHouse acquiring Xata, makes that pairing easier to buy as a managed service. It does not change the design question. You still decide by ingest, retention, query shape and cost, and you can move readings over without taking the application down.

This post is the equipment-telemetry version of that decision. For the data that lands here, see tank telemetry into dispatch and mixed-fleet ISO 15143-3 feeds.

How do you tell that Postgres is the wrong place for the readings?

Watch the workload, not a vendor benchmark.

  • Ingest and chattiness. Trackers, tank monitors and station sensors write small rows, often, and they keep doing it after hours. If autovacuum, WAL volume or disk is spending most of its time on the readings table, that table is no longer a normal OLTP citizen.
  • Retention. Thirty or ninety days of raw points is one problem; years of history for utilization, fuel and regulatory reports is another. Postgres can store it. The cost is in indexes, bloat and backups that grow with every month you keep.
  • Query shape. “Where is unit 4471, and what was its last hour reading?” is a point lookup with a join to the unit table. Postgres is good at that. “Average run hours and fuel rate by fleet for the last 90 days, rolled up by hour” is a scan and an aggregation over a large time range. That is the query that starts to argue with the application.
  • Cost. When you scale a single primary to keep analytical queries fast, you are paying OLTP prices for a warehouse job.

If those symptoms are still mild, stay on Postgres a while longer. A mid-size rental or tank platform can live for a long time on a well-partitioned readings table. Jumping to a second database has its own cost: pipelines, lag, and two places to secure.

When is partitioned Postgres, or Timescale, enough?

Partitioned Postgres is the first move when the pain is table size and retention, not a sustained analytical workload. Range-partition the readings by time (month or week is common), index the partitions you still query, and drop or archive old partitions instead of running huge deletes. Keep the unit and contract tables unpartitioned. This is ordinary Postgres, portable, and it often buys years.

TimescaleDB (or a similar Postgres time-series extension) is the next step when you want hypertables, automatic partitioning, and built-in compression or rollups without leaving the Postgres protocol. It is a fair choice when the rest of the application is already on Postgres, your team is a Postgres team, and the volume is large but not a dedicated analytics cluster. We don’t treat it as a second-class option. It is the right call when you want one engine and one operational skill set.

Move on when you know you will keep years of raw or finely rolled-up points, when many dashboards scan wide time ranges across the fleet, or when you want that analytical store to scale independently of the transactional primary.

When does ClickHouse belong in the picture?

ClickHouse belongs on the readings and the rollups, not as a replacement for the application database. It is built for large, append-heavy time series and for aggregations over those series. Equipment telemetry looks like that: GPS pings, tank levels, engine hours, lift-station levels, AMI or SCADA history.

A design that holds up:

  1. Postgres stays the system of record for assets, customers, configuration and “what is true right now.”
  2. Readings go to ClickHouse, either from the ingest path (MQTT, Kafka, or a similar pipeline) or by replicating selected tables out of Postgres.
  3. The application keeps talking to Postgres for transactions. Dashboards and heavy reports query ClickHouse, or query it through a Postgres interface if you use one.
  4. Rollups (hour, day) live in ClickHouse so you can down-sample raw points as they age.

Don’t send the unit registry or billing tables to ClickHouse as the only copy. ClickHouse’s own Managed Postgres overview draws the same line: Postgres for transactions, ClickHouse for analytics, with asynchronous replication and no shared transaction across the two. Reads that need the latest committed application state should stay on Postgres.

What did ClickHouse announce on November 9?

ClickHouse said Managed Postgres is generally available, and that it has acquired Xata. For a telemetry team already considering both engines, the useful parts are:

  • A managed Postgres next to ClickHouse, with documented paths to sync data. Official docs describe ClickPipes as the built-in CDC option (initial load plus continuous changes). WalShadow, which reads the Postgres WAL directly, is listed as a private preview for lower-latency, high-throughput replication. The GA blog also mentions a pg_clickhouse extension so applications can query ClickHouse through the Postgres interface; official docs say it is preinstalled on Managed Postgres instances.
  • Availability and commercial terms, as ClickHouse stated them: general availability on AWS, with GCP in private preview. The beta discount ends; backup storage and public network egress become billable. We aren’t repeating their performance multipliers here; measure on your own workload.
  • Xata is not fully inside Managed Postgres yet. ClickHouse says instant branches, clones, automatic idling and scale-to-zero will be integrated in the coming months, and that customers who need branching today can be onboarded to Xata in the meantime. Plan for that lag if branching is a requirement, not a footnote.

You can build the same Postgres-plus-ClickHouse shape on other hosts: self-managed, RDS or Aurora plus ClickHouse Cloud, or another CDC tool into ClickHouse. The announcement is a buying option, not a requirement.

How do we move readings without taking the app down?

Don’t cut the application over to a new store in one night.

  1. Keep writing operational data to Postgres.
  2. Stand up ClickHouse and backfill the readings you need (from Postgres, from object storage, or from the log).
  3. Turn on continuous ingest: CDC from the readings table, or a parallel publish from the MQTT/Kafka pipeline you already run. Confirm lag and row counts.
  4. Point heavy reports and new dashboards at ClickHouse. Leave “current state” queries on Postgres.
  5. Once the two agree, stop retaining long raw history on the primary, or keep a short hot window there and let ClickHouse be the long store.
  6. Only then drop or shrink the old readings partitions on Postgres.

That is a dual-run, not a freeze. The idea is the same as in migrating without a downtime freeze: both sides have to be right before you delete anything. Our database migration and data and AI platforms work follows that sequence.

FAQ

Should we put everything in ClickHouse and retire Postgres?

No. You still want a transactional system of record for units, customers and current state. ClickHouse is the analytical store for readings and rollups.

Is TimescaleDB a detour?

Not if it solves the problem you have. If your volume fits a single Postgres operational model and you want to stay there, Timescale (or careful partitioning) is a complete answer, not a half measure.

Can the application keep a single Postgres connection string?

If you use something like pg_clickhouse, some analytical queries can run through Postgres. You still have two databases, two failure domains and replication lag. Design for that, even if the app speaks one protocol.

Does ClickHouse Managed Postgres change this advice?

It changes how you can buy the two engines, and how you can replicate between them. It does not change which workload belongs where. Xata’s branching and serverless features are announced as upcoming integration, not as something already bundled on day one of GA.

How do we keep the two in sync?

CDC (ClickPipes or another Postgres CDC tool), or a pipeline that writes readings to ClickHouse as they arrive. Treat lag as a first-class metric. Don’t assume a query that joins “now” in Postgres to “now” in ClickHouse is consistent to the same transaction.

Want help with yours?

We help telematics, rental-tech and utility teams design the Postgres and ClickHouse split — schema, ingest, rollups and a cutover that leaves the application up. That’s our database migration and data and AI platforms work. Book a call and we’ll walk through your ingest rate, retention and the queries that are already hurting.

Have a project like this?

We do this work for a living.

A 30-minute scoping call with the engineers who would do the work.

Or email contact@axiointelligence.com and we’ll reply.

Keep reading

Communications satellite over the night side of Earth beaming a signal to a SIM card

Same-SIM satellite IoT: what works today

Satellite IoT can now run on the same SIM as cellular. Why it's still hard, why many satellite offers don't connect, and what to ask first.

IoTsatelliteNTN