Offload analytics queries from PostgreSQL to ClickHouse without a rewrite
When dashboards and exports slow your primary PostgreSQL, move the read-heavy analytics to ClickHouse and keep PostgreSQL for transactions. The usual pattern is change capture from PostgreSQL into ClickHouse, so the application keeps one write path. OSStend engineers design that pipeline, choose which tables move and set what stays in PostgreSQL. Both engines are open source: ClickHouse under Apache-2.0 and PostgreSQL under the PostgreSQL licence (ClickHouse licence, PostgreSQL licence, checked 23 Nov 2026). A typical design copies append-heavy tables such as events, orders and audit rows, keeps dimension tables small in ClickHouse as dictionaries or joins, and leaves anything that needs row-level updates in PostgreSQL. The first useful answer is not a tool name but a list of which 5 to 10 queries cause the load.
45 minutes with an engineer: we review your workload and sketch the design.
- ✓Our cloud
- ✓SaaS
- ✓Design
- Source
- PostgreSQL primary, logical replication
- Target
- ClickHouse, dedicated cluster
- Pipeline
- Change capture, then batched inserts
- Downtime
- None planned for the primary
- Typical timeline
- 4 to 8 weeks
Typical situation
Trigger. Report queries compete with checkout or sign-up traffic on the primary database.
Versions. PostgreSQL 14 or later with logical replication; a current ClickHouse release.
- One write path in the application
- Dashboards should stay under a few seconds
- No downtime for the primary
A typical situation, not a named customer.
To offload analytics from PostgreSQL, OSStend designs change capture from the primary into ClickHouse, moves only the append-heavy tables that cause the load, and leaves transactional tables in PostgreSQL. The application keeps one write path and dashboards read from ClickHouse.
Customers
Partners
- PostgreSQL
- MySQL
- MongoDB
- Redis
Valkey
- OpenSearch
- Kafka
- RabbitMQ
- AWS
- Google Cloud
- Azure
- Kubernetes
- OpenShift
- Prometheus
- Grafana
- Datadog
- Dynatrace
- Splunk
What OSStend runs and what you keep
OSStend designs and operates the pipeline and the ClickHouse side. You keep the application and the PostgreSQL schema.
| Area | OSStend | You |
|---|---|---|
| Query review | Rank slow queries by load, pick tables to move | Share pg_stat_statements output |
| Capture setup | Logical slot, publication and connector settings | Allow logical replication on the primary |
| ClickHouse schema | ORDER BY and partitions chosen for the dashboards | Approve column mapping |
| Initial load | Snapshot, then catch-up from the slot | Provide a read window |
| Pipeline run | Lag, errors, schema changes handled | Tell us about migrations in advance |
| Application changes | Advice on pointing reports at ClickHouse | Change the report queries |
| On call | Engineers 24/7 on both sides | Reach us by phone or ticket |
Where it can run
Most offloads start in OSStend's cloud and move into your account when the data policy asks for it.
| Option | When it fits | Licence and source |
|---|---|---|
| Our cloud | Fast start with a dedicated cluster | ClickHouse Apache-2.0, PostgreSQL licence (ClickHouse licence, checked 23 Nov 2026) |
| Your cloud account | Data policy keeps copies in your account | Same licences. See bring your own cloud. |
| Your data center | The primary already runs on premises | Same licences |
How we run it
We design before we copy anything, then load, compare and switch the reports one at a time.
Find the load (3 to 5 days)
We rank queries from pg_stat_statements by total time and pick the tables worth moving.
Design (1 to 2 weeks)
We map each moved table to a ClickHouse table, set the sorting key and decide how deletes and updates are handled.
Initial load (1 to 2 weeks)
A consistent snapshot loads first, then the logical slot catches up. See change data capture.
Compare (1 to 2 weeks)
We check row counts and sample query results between PostgreSQL and ClickHouse.
Switch reports (1 to 5 days)
Reports move one by one. PostgreSQL is untouched, so rollback is a config change.
Run (from day one)
We run the pipeline and cluster 24/7. See how it works.
Cost basis
The saving comes from keeping the PostgreSQL primary smaller, not from the ClickHouse line alone. OSStend's price is quoted per design.
Compare two futures: scale the primary up to carry reports, or hold it at its current size and add a ClickHouse cluster. The first grows with data and query count. The second grows with data only, and compressed columnar storage is usually smaller than the row store. We do not assume a ratio; we measure one table.
| Option | What grows | What you pay for |
|---|---|---|
| Scale the primary | CPU, memory, IOPS and replicas | Larger instance classes, more replicas |
| Offload to ClickHouse | ClickHouse storage and a pipeline | A dedicated cluster, quoted per design |
| Read replica only | Replica count | Another full copy, same engine limits |
A read replica helps with load but keeps the row-store limits. Use the TCO calculator to compare with your numbers.
What we watch on call
An offload adds one moving part. These are the failure patterns we watch for in the pipeline and the target.
- Replication slot lag.
- An idle or slow consumer makes PostgreSQL keep WAL. We watch confirmed_flush_lsn and disk free on the primary.
- Schema drift.
- A new column or type change in PostgreSQL can stop the pipeline. We review migrations ahead of release.
- Duplicate or missing rows.
- We run a count and checksum comparison on a schedule.
- Small inserts.
- Per-row inserts create too many parts. We batch on the pipeline side.
- Update-heavy tables.
- Frequent updates fit ClickHouse poorly. We flag tables that should stay in PostgreSQL.
- Dictionary staleness.
- Lookup tables loaded as dictionaries must refresh on a clear schedule.
When OSStend is not the right fit
This fits teams whose reports hurt transactional latency and whose data is mostly append-only.
Contact us if
- ✓Report queries slow the primary at peak
- ✓Most big tables are append-heavy
- ✓You can accept seconds of lag on dashboards
- ✓You want one engineer team for both engines
Not a fit if
- ✕Your reports need to read their own writes instantly
- ✕Most tables are updated row by row all day
- ✕The primary is small and a replica solves it
- ✕You want to replace PostgreSQL entirely
Questions buyers ask
These are the questions we hear most on this situation. Each answer is general; the design review settles the figures for your estate.
Do we need to change the application's write path?
No. The application keeps writing to PostgreSQL. Only the report queries change, and they change one at a time.
How fresh is the data in ClickHouse?
Typically seconds to a minute behind, set by batch size. The design states the target lag.
What about deletes and updates?
We choose per table: ReplacingMergeTree, a deleted flag or a periodic rebuild. Tables with heavy updates often stay in PostgreSQL.
Can OSStend also run the PostgreSQL side?
Yes. See managed PostgreSQL. A single contract covers both engines.
Related pages
- Deployment · Your cloud accountBring your own cloud (BYOC) managed databasesBring your own cloud with OSStend: engineers run PostgreSQL, Kafka and more inside your AWS, Azure or Google Cloud account, so data and billing stay yours.
- GuideChange data capture (CDC): methods and toolsChange data capture explained: log-based vs query-based CDC, the main CDC tools, Postgres CDC and replication slots, and when to pay someone to run it.
- How it worksHow OSStend works: design, move, runOSStend designs your cluster around the workload, moves it in with zero downtime and runs it 24/7. See the three steps and what turnkey services leave out.
- Tools · CostManaged database cost calculatorFree managed database cost calculator: price one cluster self-run, on a cloud database service and with managed providers, from sourced, dated list prices and your team's time.
- PostgreSQLManaged PostgreSQL service and Postgres hostingManaged PostgreSQL service, compared: how to choose between RDS, Aiven, Crunchy Bridge, Neon and a tailored cluster run 24/7 in your cloud or ours.
Find the queries worth moving
Send your top queries by total time and we will tell you which tables to move first.
- ✓A design sketch for your workload, not a plan menu
- ✓A zero-downtime cutover path for what you run today
- ✓A price for that design, after the review





