Operational vs analytical data stores
Every organization has two kinds of data workload. Operational (OLTP: online transaction processing) systems run the business: taking orders, updating accounts, recording payments, one record at a time, many times a second. Analytical (OLAP: online analytical processing) systems help people understand the business: totals, trends and models over millions of records.
The two need different storage designs. Running heavy analytics on the operational database slows down the business; running the business on an analytical store gives up the guarantees transactions need.
Diagram
Section titled “Diagram”- Changes leave the operational databases without loading them, ideally through change data capture.
- Data is cleaned, joined across sources and given history.
- It lands in a store designed for scanning and aggregating large volumes.
- Reports, dashboards and models query the analytical store, not the operational databases.
How they differ
Section titled “How they differ”| Aspect | Operational (OLTP) | Analytical (OLAP) |
|---|---|---|
| Typical query | Read or update one order | Total revenue by region and month for three years |
| Rows touched per query | A few | Millions to billions |
| Storage layout | Row-oriented: a whole record together | Column-oriented: each column together, compressed |
| Data model | Normalized, to avoid update anomalies | Denormalized (star schemas, wide tables) for fast reads |
| History | Current state, often overwritten | Full history, often with time-variant dimensions |
| Consistency need | Strong: transactions, constraints | Usually tolerates minutes or hours of delay |
| Users | Applications | Analysts, data scientists, dashboards |
| Examples | PostgreSQL (opens in a new tab), MySQL, SQL Server, Oracle, DynamoDB | Snowflake, BigQuery, Redshift, Databricks, ClickHouse |
Moving data between them
Section titled “Moving data between them”- Batch extract (ETL or ELT): periodic copies, simple, with hours of delay. Avoid full-table extracts from busy databases at peak times.
- Change data capture: stream every committed change from the transaction log; minutes or seconds of delay and little load on the source.
- Business events: services publish domain events (OrderPlaced, PaymentTaken) that both other services and the analytics platform consume. Better contracts than raw table changes.
- Read replicas: a copy of the operational database for reporting. A quick fix for light reporting, but still row-oriented, so heavy analytics remain slow.
Blurring the line
Section titled “Blurring the line”Some systems now serve both workloads: HTAP (hybrid transactional/analytical processing) databases keep row and column copies of the same data, and operational databases add columnar indexes. They’re useful when you need analytics on very fresh data from one system. They don’t remove the need for an analytical store that combines data from many sources with history.
Common pitfalls
Section titled “Common pitfalls”- Reports on the production database, which work until month-end, when a heavy query slows down checkout.
- Treating the warehouse as an integration hub, where operational systems read each other’s data from the analytics store and break when a pipeline is late.
- Losing history because the operational system overwrites values and the analytical copy only stores the latest state.
- No owner for data definitions, so “active customer” means three different things in three dashboards.
Related patterns
Section titled “Related patterns”- Data warehouse, data lake and lakehouse
- CQRS, the same separation applied inside one application
- Which data platform?
- Architecture for DBAs
Written and edited by Abhinav Taduka, enterprise software architect.
New pages are added regularly. Follow Abhinav on LinkedIn to see them first.