How do OLTP databases and data warehouses serve different workloads?
Instruction: Compare an order-processing transaction with a historical sales analysis. Explain the workload, modeling, history, and freshness differences without treating them as absolute product limitations.
Updated
Example answer
A data warehouse integrates data for analysis, often retaining history from several operational sources. A transactional database supports the application's day-to-day operations, such as creating an order and reserving stock atomically. A warehouse is itself a database; “traditional database” is too broad to be the useful distinction. The relevant comparison is analytical versus transactional workloads.
| Design concern | Transactional workload (OLTP) | Warehouse workload (OLAP) |
|---|---|---|
| Typical request | Read or update a few orders by key | Aggregate sales over months and regions |
| Priority | Correct concurrent transactions and low request latency | Efficient scans, joins, and aggregates over large datasets |
| Data organization | Often normalized to constrain updates | Often dimensional models with declared fact grain and shared dimensions |
| History and freshness | Current application state, sometimes with history | Integrated historical records, with an explicit ingestion delay |
These are design tendencies, not absolute rules: transactional systems can retain history, warehouses can support transactions, and hybrid systems exist. ETL or ELT pipelines reconcile source keys, types, business definitions, and late or corrected events. A separate analytical workload can reduce contention on the operational system, but ingestion, compute, storage, and governance add cost.
For a shop, placing an order belongs in the transactional system. Comparing monthly revenue across stores belongs in the warehouse once the source records have been reconciled. Define “revenue” and freshness requirements before choosing an architecture.
Related Questions
-
easy
-
easy
-
easy
-
medium
-
hard