OLTP vs OLAP
Data Warehousing · 11 questions
Short notes
Key idea
OLTP systems run the business: many small reads and writes of single rows (place an order, update stock). OLAP systems analyse it: few large queries that scan and aggregate millions of rows.
Syntax
| OLTP | OLAP | |
|---|---|---|
| Users | the app, many at once | analysts, dashboards |
| Query | one row by key | scan and aggregate |
| Model | normalised (3NF) | star schema |
| Storage | row-based | column-based |
| Examples | PostgreSQL, MySQL | BigQuery, Snowflake, Redshift |
Example
Checkout writes one order row to PostgreSQL in milliseconds. The nightly "revenue by city by month for two years" query runs in BigQuery, which reads only the city, date and amount columns.
Traps
- Running heavy reports on the production database slows the app for customers.
- Using a warehouse as an app database: single-row updates are slow and costly there.
- Copying OLTP tables unchanged gives analysts dozens of joins.
- Freshness: a warehouse usually lags the source by minutes or hours; say so on dashboards.
Want the full lesson with step-by-step examples, a project and a certificate? Data Warehousing course, ₹120 →
Questions
5 free questions- Question 1easy
Which workload is OLAP?
- Question 2medium
Why not run all reports directly on the app's production database?
- Question 3medium
Which storage layout suits OLAP queries that read a few columns across millions of rows?
- Question 4easy
Which is an OLAP data warehouse?
- Question 5easy
Which query is typical of an OLTP system?
OLTP vs OLAP
OLTP vs OLAP
OLTP vs OLAP
OLTP vs OLAP
OLTP vs OLAP
6 more questions on this topic, with hints, and tests
Sign up free for 21 days of every question and test.