# ClickHouse

> A free, open-source database that stores data in columns. It is built for quick sums.

**Field:** Data Engineering  
**Category:** Storage & Warehousing  
**Also known as:** ClickHouse Cloud, ClickHouse DB

## Think of it like

It is like a sorting machine at a post office. Huge piles go in, and the counts come out fast.

## Definition

ClickHouse is an open-source database built for fast analytics. It stores data in columns and answers SQL queries over very large tables. Work on it began in 2009, and it was released as open source in 2016 under the Apache 2.0 license. You can run it yourself or pay for its cloud version. It is often used for live dashboards over event and log data.

## Example

A game studio sends every player click to ClickHouse. Its live dashboard shows how many people are playing each level right now.

## Example code

```sql
CREATE TABLE events
(
    event_date Date,
    user_id UInt64,
    action String
)
ENGINE = MergeTree
ORDER BY (event_date, user_id);
```

MergeTree is its main kind of table. ORDER BY sets how rows are sorted on disk.

## Why it matters

It answers big questions fast enough for live charts. The open-source version costs nothing to run.

## Common mistake

Using it like an app database with many small updates. It works best when data comes in big batches and rarely changes.

## Three principles

- **Columns.** Data is stored one column at a time.
- **Batches in.** Add rows in large groups.
- **Open source.** Run it yourself, or rent the cloud one.

## Related terms

- [Columnar Storage](https://learn.benibix.com/term/data/columnar-storage)
- [Real-Time Analytics](https://learn.benibix.com/term/data/real-time-analytics)
- [Data Warehouse](https://learn.benibix.com/term/data/data-warehouse)
- [Online Analytical Processing (OLAP)](https://learn.benibix.com/term/data/olap)
- [Event Data](https://learn.benibix.com/term/data/event-data)
- [Time Series Data](https://learn.benibix.com/term/data/time-series-data)

## Told apart from

- [ClickHouse vs DuckDB](https://learn.benibix.com/compare/clickhouse-vs-duckdb): People think ClickHouse and DuckDB are the same kind of tool, since both store data in columns and add up numbers fast. DuckDB runs inside your own program, on one machine, with no server. ClickHouse runs as a server, often on many machines. Many people can query it at once. Use DuckDB on a laptop and ClickHouse behind a live dashboard.

![The same three-row table stored two ways. In row storage each row's id, city and total sit side by side on disk. In column storage all the ids sit together, then all the cities, then all the totals, so a query for totals reads one block.](https://learn.benibix.com/diagrams/row-vs-column-storage.svg)

---

Source: https://learn.benibix.com/term/data/clickhouse
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
