Skip to content
IT glossary
DatabasesUpdated December 3, 2026

Columnar database

Колоночная база данных

A database that stores values from the same column together rather than storing each row’s fields together. This helps queries that scan many rows but need only a few columns.

Also known as: колоночное хранение

What makes a database columnar?

Take a table of website events. Each row has a timestamp, an event type, a country, and a payload. A row store keeps those fields together for each event. A columnar store keeps timestamps together, event types together, and so on. The table still has rows when you query it: the difference is how the data is laid out in storage, not how you write SQL.

How the layout helps

Engines typically split a table into chunks and store each chunk’s columns separately. Values at the same logical position in a chunk belong to the same row. A query can read the columns it needs and leave the rest untouched. Remember to count columns used in filters and grouping, not just columns named in the output.

Keeping values of the same type together also helps compression. A country column, for instance, can store short codes that refer to a dictionary of country names. Reading fewer bytes can reduce I/O, and many engines also process values in batches. Some engines keep metadata such as the minimum and maximum timestamp in a chunk. A query can use those bounds to skip chunks outside its time range. Skipping chunks and skipping unused columns are two distinct optimizations.

Example: Count page views by country

SELECT country, COUNT(*) AS views
FROM events
WHERE event_type = 'page_view'
  AND event_date >= '2025-01-01'
GROUP BY country;

The engine needs event_type and event_date for the filters and country for grouping. It does not need the event ID or the payload, even though the query uses COUNT(*): the asterisk here means count rows, not return every column. On a wide table with large payloads, leaving those payloads unread can save more work than any change to the counting step.

When to choose it

Columnar databases such as ClickHouse are common in data warehouses, event analytics, and reporting. They fit workloads that repeatedly scan many rows, group them in different ways, and load new data in batches. For an application that looks up one record by an indexed key, returns most of its fields, and frequently updates individual records, a row store is often the better default. Actual costs depend on the engine, indexes, sort order, and query mix.

Columnar describes a storage layout; OLAP describes an analytical workload. The two often go together, but they are not interchangeable. A wide-column database such as Cassandra uses a different data model; the term wide-column does not imply columnar storage optimized for analytical scans.

How it comes up in interviews

You might be asked to pick storage for a checkout service and a sales dashboard. Compare their access patterns first: checkout reads and changes a small number of orders, while the dashboard summarizes many orders using a few fields. Then explain what you would measure: point-query latency for checkout, and bytes read and query time for the dashboard.