ClickHouse for Data Warehousing: How Fast Is It and When Does It Fit?

ClickHouse can write millions of rows per second and aggregate billions of rows in seconds. Learn how it works, how fast it is, and when it does and does not fit as a data warehouse.

Once transaction data reaches hundreds of millions of rows, reports that used to finish in seconds start taking minutes, or even hours. At this point many data teams start looking at ClickHouse, an open-source analytical database known for being extremely fast at aggregating large data.

This article explains what ClickHouse is, why it is fast, how fast it writes data, and most importantly: when ClickHouse is a good fit as a data warehouse, and when it is not.

What is ClickHouse?

ClickHouse is a columnar database for OLAP (Online Analytical Processing). Unlike transactional databases such as MySQL or PostgreSQL, which store data row by row, ClickHouse stores data column by column. When you run a query like “total sales per month”, ClickHouse reads only the date and sales columns, not the whole table.

ClickHouse can be self-hosted on your own servers (on-premise) for free, or used as a managed service such as ClickHouse Cloud.

Why is ClickHouse so fast?

  • Columnar storage and compression. Values in one column tend to be similar, so they compress far better, and less data has to be read from disk.
  • Vectorized execution. Data is processed in blocks rather than row by row, so the CPU works much more efficiently.
  • Full parallelism. One query uses every CPU core, and on a cluster it can be spread across many servers.
  • Sort order (ORDER BY) as an index. MergeTree tables are stored in order, so queries that filter on the sort key can skip most of the data.

How fast does ClickHouse write data?

The official ClickHouse documentation says the database is designed to insert millions of rows per second. A rough picture:

  • Single server (single node): around 1–2 million rows per second, roughly ~1 GB/second of uncompressed data. In one public test, 10 million rows were inserted in 4.6 seconds, about 2.1 million rows per second. With large batches and pre-sorted data, a single high-powered machine can reach 5 to 8.8 million rows per second.
  • Cluster (multi-node): write speed scales almost linearly with the number of shards. In a 50-server cluster test, write speed held at 400–500 million rows per second, peaking at 1 billion rows per second.

These numbers come from tests under ideal conditions. Real-world speed depends on hardware, data format, and above all on how data is inserted. ClickHouse recommends inserting in batches of at least 1,000 rows, ideally 10,000–100,000 rows, at around one insert query per second. Thousands of tiny single-row inserts will overwhelm it.

When is ClickHouse a good fit?

  • Dashboards and reports on large data. Aggregating hundreds of millions to billions of rows in seconds, paired with Superset, Metabase, or Power BI.
  • Event and time-series data. Application logs, website clicks, transactions, IoT sensor data, or vehicle GPS points.
  • Near real-time analytics. Data from Kafka or CDC with Debezium can land and be analyzed right away.
  • Limited budgets. The open-source version can be self-hosted with no license fee, and its compression saves disk space.

When should you not use ClickHouse?

  • As an application (OLTP) database. For applications that update single rows often, such as updating customer profiles every few seconds, use PostgreSQL or MySQL. ClickHouse now supports UPDATE and DELETE, including much faster lightweight updates, but it is still not designed for row-by-row transactions.
  • Transactions that need strict consistency. For example balance or stock records that must be locked per transaction.
  • Many small inserts from an application. If they cannot be batched, buffer them in a queue first (such as Kafka) or use async inserts.
  • Small data. If you only have a few million rows, a well-designed PostgreSQL database is often enough and easier to maintain.

A simple example architecture

  1. Data from transactional applications (MySQL/PostgreSQL) is copied through ETL, for example Apache Hop or Airflow, or in real time through CDC.
  2. Raw data lands in ClickHouse and is shaped into fact and dimension tables using a star schema.
  3. BI tools read from ClickHouse for leadership dashboards and routine reports.

One thing to remember: no database, however fast, can fix messy data. Data model design and data quality still decide whether the numbers on a dashboard can be trusted.

Conclusion

ClickHouse is an excellent data warehouse engine for analytics on large data: fast to write, fast to read, and efficient on storage. But it is not a replacement for an application database. The combination that most often works is a transactional database for applications, and ClickHouse for reporting and analytics.

Discuss your data architecture

The DNASTUDIO team has experience building data warehouses with ClickHouse, BigQuery, and DB2 BLU, complete with ETL and BI dashboards. We can also help you assess whether ClickHouse really fits your needs.

Sources

Leave a comment

Your email address will not be published. Required fields are marked *