Every database faces the same physical question: when a table is written to disk, what sits next to what? One option keeps all the fields of a single record adjacent, so a row is one contiguous blob. The other keeps one field across many records adjacent, so a column is one contiguous stream. The data is identical; only the arrangement changes. Yet that arrangement decides whether a query touches a few bytes or reads half the disk.
Row storage is optimised for fetching and changing whole records, while columnar storage is optimised for reading a few fields across millions of records, and mixing the two up is one of the most expensive mistakes in data engineering.
Understanding the layout explains why an analytics query can be a hundred times faster on one system than another without either database being badly written.
Part One: What each layout actually does
In a row store, a table is a sequence of records. Reading one customer — their name, address, balance, and status — is a single seek and a small read, because all those fields were written next to each other. Updating that customer's balance touches one place. This is the natural shape for online transaction processing, where applications repeatedly fetch and mutate individual records by key.
In a columnar store, a table is a set of columns, each stored as a contiguous array. Reading the average balance across ten million customers touches only the balance column; the names, addresses, and statuses are never read at all. Because values in one column tend to be similar, compression works extremely well, and a column can often be scanned faster than the raw bytes would suggest. This is the natural shape for analytics, which asks questions across huge numbers of rows but usually needs only a handful of fields.
Neither layout is newer or better. They are answers to different access patterns, and a query that is trivial in one can be painful in the other.
Part Two: The arithmetic of scanning
Suppose a table has fifty columns and a hundred million rows, and an analyst wants the total revenue for one month. A row store must read every row to extract the single date and revenue fields it needs. If rows average two hundred bytes, that is twenty gigabytes read from disk to compute an answer that touches perhaps twelve bytes per row. With compression and indexes this can be improved, but the fundamental waste remains: you pay to move fields you never use.
A columnar store reads only the date and revenue columns. If each is compressed to a fraction of its raw size, the scan might touch a few hundred megabytes instead of twenty gigabytes. On modern hardware that is the difference between minutes and seconds. The global analytics and business-intelligence market is worth tens of billions of dollars, and a large share of that spend is essentially paying for this one decision — how many bytes a question has to drag through the machine.
Writes tell the opposite story. Inserting one row into a columnar table means touching fifty separate column structures, which is why column stores batch writes and are poor at single-record updates. A row store handles that insert in one place. The arithmetic of the trade is therefore: save enormously on reads of few columns, pay on small writes and on queries that need many columns at once.
Columnar storage wins when you scan many rows and few columns, while row storage wins when you touch few rows and many columns, and the crossover is set by how many fields your query actually needs.
That is the whole decision, and it can be computed from the query mix rather than guessed from fashion.
Part Three: Where each layout breaks
Row storage breaks under wide analytical scans. A dashboard that aggregates years of events forces the database to read enormous volumes of irrelevant fields, and no amount of caching fully hides it. Teams often respond by building separate summary tables, which is a symptom of the layout fighting the workload.
Columnar storage breaks under high-frequency point updates. A system that changes one user's record hundreds of times a second generates constant small writes across many column files, and the merge machinery that keeps columns efficient falls behind. It also struggles when a query needs almost every column, because the advantage of skipping fields disappears while the cost of stitching rows back together remains.
This is why many modern databases are hybrid. They keep a row-oriented buffer for recent writes and move data into a columnar format for analytical reads. The engine quietly chooses a layout based on age and access pattern, giving the application both behaviours without forcing the engineer to pick a side at design time.
Part Four: An everyday example
Think of a library catalogue. A row layout is like a card for each book, with title, author, year, and shelf all on one card. Finding everything about a single book is instant: pull one card. A column layout is like a separate list of all titles, a separate list of all authors, and a separate list of all years. Answering "how many books were published after 2010" means reading only the year list, which is fast even for a million books. But adding a single new book requires updating several lists, and reading the full details of one book means pulling a line from each list and reassembling it.
A librarian who helps people find individual books wants cards. A librarian who produces annual statistics wants lists. A real library keeps the catalogue in one form and exports the other for reports, which is exactly the hybrid idea.
What is actually transferable
The deeper lesson is that data layout is a decision about which questions are cheap. There is no neutral representation — arranging bytes to favour one access pattern necessarily makes another more expensive. Before choosing a store, list the actual queries you expect and count how many rows and columns each one touches. That single habit predicts performance better than reading benchmarks built for somebody else's workload.
A second lesson is that the two layouts are not enemies. Keeping fresh data in rows and historical data in columns is a coherent design, not a compromise, because the two kinds of data have different access patterns. Once you see storage as a bet on query shape, the choice stops being ideological and becomes a calculation you can redo whenever the workload changes.
Rows and columns are not competing formats for the same table but two different bets on which questions will be asked, and a good system makes that bet explicitly rather than by accident.
SOL: HCqPmPJM3NVtS6YrmVaTZYnuP8XZ2PFgQZKT94VK1LkS
Creating this takes real effort — thank you for the support.


