OLTP vs OLAP Explained Simply
If you’re new to data engineering, you’ll hear these two acronyms constantly: OLTP and OLAP. They sound like jargon, but the idea behind them is simple. Once you get it, a lot of other things in data engineering (why we build data warehouses, why we copy data out of production databases, why star schemas exist) will start to make sense.
Let’s break it down.
Two very different jobs
Imagine two people working at a bank.
The first person is a teller. Someone walks up, deposits $200, and walks away. Then the next person withdraws $50. Then someone opens a new account. Each of these is a small, quick transaction. The teller doesn’t care about the bank’s history; they care about doing this one transaction, correctly, right now.
The second person is an analyst. At the end of the month, they ask questions like: “What was our average account balance across all branches in Amsterdam over the last year?” This isn’t one small task; it’s a question that touches millions of past transactions to produce one answer.
These two jobs need different tools. That’s the whole idea behind OLTP and OLAP.
OLTP: Online Transaction Processing
OLTP systems are built for the teller’s job: many small, fast operations happening constantly.
- A customer places an order on a website → OLTP
- A user updates their email address → OLTP
- A payment gets processed → OLTP
Characteristics of OLTP systems:
- Many short transactions. Thousands of small reads and writes per second.
- Row-oriented storage. Data is stored row by row, because a transaction usually needs a full record (e.g., “get everything about order #4521”).
- Strong consistency. If you deposit money, the balance must update immediately and correctly, no exceptions.
- Normalized schema. Data is split across many related tables (customers, orders, products) to avoid duplication and keep updates fast and safe.
Examples of OLTP databases: PostgreSQL, MySQL, Oracle DB, SQL Server, used the way most applications use them, as the “system of record.”
OLAP: Online Analytical Processing
OLAP systems are built for the analyst’s job: asking big questions across huge amounts of historical data.
- “What were total sales by region last quarter?” → OLAP
- “How many users churned after their first month, by signup channel?” → OLAP
- “What’s the trend in average order value over the last 3 years?” → OLAP
Characteristics of OLAP systems:
- Few, but heavy, queries. Instead of thousands of tiny transactions, you get queries that scan millions or billions of rows.
- Column-oriented storage. Data is stored column by column, because analytical queries usually only need a few columns (e.g.,
sale_amountandregion) but across every single row. This makes scanning much faster. - Denormalized schema. Data is often flattened or organized into structures like star schemas, trading storage space for simpler, faster queries.
- Read-heavy, not write-heavy. Data is usually loaded in batches (hourly, daily) rather than updated row-by-row in real time.
Examples of OLAP systems: Snowflake, BigQuery, Redshift, ClickHouse.
Why not just use one system for both?
This is the natural next question, and it’s a good one. In theory, you could run analytical queries directly against your production OLTP database. In practice, this causes two problems:
- Performance. A heavy analytical query scanning millions of rows can slow down or lock the exact tables your live application needs for fast transactions. You don’t want a monthly report to make checkout slow for customers.
- Shape mismatch. OLTP schemas are normalized for safe, fast writes. That’s great for updating one order, but painful for analytics: you’d need to join a dozen tables just to answer one business question.
So the common pattern is:
- Data is created and stored in OLTP systems (the applications people use every day).
- That data gets extracted, transformed, and loaded (this is the ETL/ELT you’ll hear about constantly) into an OLAP system.
- Analysts and dashboards query the OLAP system, leaving the OLTP system free to do its job: handling live transactions.
flowchart LR
A[(OLTP<br/>e.g. Postgres)] -->|ETL / ELT pipeline| B[(OLAP<br/>e.g. Snowflake)]
B --> C[Dashboards]
B --> D[Analysts]
This separation is one of the main reasons the data engineering role exists: moving data safely and reliably from the OLTP world to the OLAP world.
A simple mental model
| OLTP | OLAP | |
|---|---|---|
| Purpose | Run the business | Understand the business |
| Query type | Many, small, fast | Few, large, complex |
| Data model | Normalized | Denormalized (e.g., star schema) |
| Storage | Row-oriented | Column-oriented |
| Example question | “Update this customer’s address” | “What’s our revenue trend by region?” |
| Example tools | PostgreSQL, MySQL | Snowflake, BigQuery, Redshift |
The takeaway
OLTP keeps the business running, one transaction at a time. OLAP helps you understand the business, one big question at a time. Neither is “better”: they’re built for different jobs, and most companies need both, connected by a good data pipeline in between.
Once this clicks, a lot of other data engineering topics (data warehouses, star schemas, ETL vs ELT) will make a lot more sense, because they all exist to bridge the gap between these two worlds.