OLTP, OLAP and Columnar Storage
Two workloads that want opposite things from disk, and the storage layout that serves each.
OLTP, OLAP and Columnar Storage
The two workloads on one table
Two workloads that want opposite things from disk, and the storage layout that serves each.
The two workloads on one table
Online Transaction Processing (OLTP) handles many small operations that read or change a few records, such as placing an order. It usually needs low-latency lookups, concurrent writes, and transactional guarantees.
Online Transaction Processing (OLTP) handles many small operations that read or change a few records, such as placing an order. It usually needs low-latency lookups, concurrent writes, and transactional guarantees.
Online Analytical Processing (OLAP) answers questions across large datasets, such as monthly revenue by region. It often reads many rows but only a few columns, and can benefit from scans and aggregation. These are workload patterns, not mutually exclusive kinds of product. A system may support both, though one workload can interfere with the other.
A row-oriented layout keeps fields from one record together, which suits retrieving or updating a complete record. A columnar layout stores values from the same column together. An analytic query that reads only region and revenue can avoid unrelated fields and may compress repeated values well.
Column storage does not guarantee a particular speedup. Results depend on compression, data distribution, query shape, hardware, and engine. Column stores also have trade-offs for point updates and transactional access.
Start from actual query and concurrency needs. Use a transactional store for frequent, small updates; use an analytical warehouse or columnar engine when broad scans and aggregations dominate. Moving data between systems introduces freshness, failure, and reconciliation questions. Benchmark both workloads under realistic concurrency. For an analytical dimensional design, see star schema.
A checkout query that fetches one customer's current cart needs a fast point lookup and a small write. A monthly revenue report may scan many transactions, group them by region, and return only a few columns. The first workload tends to value predictable response time under concurrent updates; the second values scan throughput and compression. Combining them on one system can work at modest scale, but a large report may compete with checkout. Run representative concurrent tests before separating the workloads.
A mixed workload can remain on one engine if transactions and reports meet their latency targets. Measure transaction p95 latency while the analytical query runs, not only each query in isolation. If the report disrupts writes, options include a replica, scheduled extraction, workload limits, or a dedicated warehouse. Each introduces data freshness and operational cost. Row versus column storage is one design factor; caching, indexes, partitioning, concurrency control, and hardware also affect the outcome.
Answer without scrolling back up.
Why is a row store slow at averaging one column over ten million rows?
To read 8 bytes of interest you read the whole 200-byte row. A column store reads only the region holding that column.
Why do column stores compress so much better?
Ten-times ratios are ordinary, and since the bottleneck is I/O, less data read is most of the speed-up.
What goes wrong when reports run against the production OLTP database?
The dashboard is slow and the checkout is slow, and the cause is not visible in the application's own metrics.
Compare row storage and columnar storage on the same table, run an analytical query on each, and see why dashboards need a different engine.