DuckDB vs ClickHouse: Why we use both at PostHog
Blog post from PostHog
ClickHouse and DuckDB are two prominent OLAP systems, each with distinct features and use cases, leading to their adoption by companies like PostHog. ClickHouse is a highly configurable and scalable database designed for fast analytical queries on massive data distributed across multiple instances, making it ideal for real-time application analytics. In contrast, DuckDB is a lightweight, embeddable OLAP engine that excels at fast exploratory analytics on a single machine, suitable for smaller, spontaneous queries without the overhead of network communication. While ClickHouse is a dedicated server supporting horizontal scaling and complex queries with materialized views and indexes, DuckDB functions more like an embedded engine with flexibility in querying semi-structured data directly from files. PostHog utilizes both databases: ClickHouse powers their analytical engine for large-scale event data, while DuckDB, integrated with DuckLake and Duckgres, provides a manageable data warehouse solution compatible with Postgres-ready systems, enhancing their full data stack offering.
| Trend | Post Mentions | Total Month Mentions | Posts | Companies | MoM |
|---|---|---|---|---|---|
| Real-time | 2 | 6,790 | 1,736 | 269 | -9% |
| Developer Experience | 1 | 518 | 294 | 120 | -30% |
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.