Skip to content
BENIBIX Learn

Row-Oriented vs Columnar Storage

People think row storage and column storage hold different data. They hold the very same table, just laid out two ways on disk. Row storage keeps each record together, so writing one order is fast. Column storage keeps each column together, so adding up one column is fast. Apps use rows. Warehouses use columns.

Data🗄️ Storage & Warehousing

Row-Oriented Storage

Each row is kept together on disk. It is quick for one record at a time.

Row-oriented storage keeps all the values of one row next to each other on disk. Reading or writing one whole record is quick, because it sits in one place. Reading one column from many rows is slow, because every full row must be read. Most databases that run apps store data this way. Warehouses tend to use columnar storage instead.

Example
When Jack places an order, the shop's database writes his whole order row in one place. Showing his order later reads that one spot.
Why it matters
It is why app databases handle many small writes fast. It is also why big reports on them are slow.
Full entry
Data🗄️ Storage & Warehousing

Columnar Storage

A table kept one column at a time. A report reads just the columns it needs.

Columnar storage keeps each column of a table together on disk. A row store keeps each whole row together instead. A report that needs two columns out of fifty reads only those two. Values in one column look alike, so they also squeeze down well. This makes big scans fast, but writing one row at a time is slow.

Example
A sales table has 50 columns. A query for total sales by month reads just the date and amount columns, a tiny part of the file.
Why it matters
It is why warehouses can scan billions of rows in seconds. Less data read means faster and cheaper queries.
Full entry

In one line

Row-Oriented Storage
Each row is kept together on disk. It is quick for one record at a time.
Columnar Storage
A table kept one column at a time. A report reads just the columns it needs.