ClickHouse
ClickHouse is Watasu’s analytical database. Reach for it when you have lots of append-only data and you want to slice and aggregate it fast.
Don’t use it as a replacement for PostgreSQL — it’s not built for OLTP workloads and you’ll hate it for that.
Good fits
Section titled “Good fits”- product analytics events
- audit logs at scale
- time-series data
- dashboards over millions or billions of rows
- exploratory analytics where wide aggregations need to return in seconds
Create
Section titled “Create”watasu addons:create clickhouse --app my-appAfter attachment, your app receives ClickHouse connection details as config vars. Use any standard ClickHouse client library.
Open an interactive session
Section titled “Open an interactive session”watasu clickhouse:cli --app my-appBackups
Section titled “Backups”ClickHouse supports manual backups, scheduled backups on supported plans, and restore from managed backups or uploaded archives.
Capture
Section titled “Capture”watasu addons:backups:capture analytics-dbRestore
Section titled “Restore”watasu addons:restore analytics-db ./warehouse-backup.zip --name analytics-db-restoredwatasu addons:promote analytics-db-restoredSee Backups and Restores for the full workflow.
- Keep ClickHouse separate from your transactional database. Mixing dashboards and OLTP on one engine ends badly for both.
- Validate your restore process before you need it. ClickHouse archives can be large and surprises during an incident are expensive.
- Pre-aggregate where possible — ClickHouse loves materialized views.