A Sivaro topic map · 4 of 13 pages ready
ClickHouse: when to add it beside Postgres, and how
Keep Postgres for the app. Add ClickHouse beside it for reports, fed by a sync pipeline, when the warning signs show.
- Situation
- Your app runs on Postgres, and it works well.
- Complication
- As data grows, reports and dashboards get slow, and a big report can freeze the app for customers. Summary tables pile up.
- Question
- Do you need ClickHouse, and how do you add it without breaking what works?
- Answer
- Keep Postgres for the app. Add ClickHouse beside it for reports, fed by a sync pipeline, when the warning signs show.
The map: each part proves one piece of the answer
- 01 Why reports get slow Why your reports slow down the whole app The app database is made for many small writes. Reports read millions of rows at once, so they need a different kind of database.
- Why some databases answer reports in seconds Soon A columnar database keeps each column together, so a report reads only the columns it needs.
- The database built for reports, not for apps Soon An OLAP database is made for big reads and totals over history, not for the small updates of an app.
-
- 02 When Postgres is not enough Your dashboards got slow as your data grew Postgres is enough until reports slow down the app or need a pile of summary tables. Then add an analytics database beside it.
- 03 Which database to choose Are big reports slowing down your app? Keep Postgres for the app and its updates. Use ClickHouse for reports over a large history.
- Your data warehouse bill is too high Soon Both answer big reports. The choice is about cost, speed for dashboards and how much the team wants to run itself.
- Reports on one laptop or for the whole team? Soon DuckDB runs inside one program on one machine. ClickHouse is a server that many users and dashboards share.
- Your BigQuery bill grows with every dashboard Soon BigQuery charges by the data each query reads. ClickHouse runs on servers that you size, so the cost of busy dashboards is easier to plan.
-
- 04 How to add it beside Postgres Fast reports without breaking your live app Copy each change from Postgres to ClickHouse with a sync pipeline, so the app keeps working and reports read fresh data.
- Copy every new order to reports in seconds Soon PeerDB is a tool that copies Postgres changes into ClickHouse in near real time.
- Dashboards that stay fast as data grows Soon A materialized view keeps a summary table up to date as new rows arrive, so dashboards read small, ready results.
-
- 05 What it costs What fast reports cost you each month Soon ClickHouse itself is free open source. You pay for the servers, or for ClickHouse Cloud by use.
- Pay for reports only while they run Soon ClickHouse Cloud bills compute and storage by use, so the bill depends on how long the servers run.
-