🛠 Learn ERWIN

OLTP vs OLAP

Transactional systems vs analytical systems — completely different design priorities.

OLTP (Online Transaction Processing) and OLAP (Online Analytical Processing) are two fundamentally different ways of using databases. Confusing their priorities is the #1 cause of slow, painful data systems.

The split

OLTP — running the business

Stores and processes individual transactions in real time. Powers your apps, e-commerce sites, banking systems.

Example: an ATM withdrawing $100

OLAP — understanding the business

Aggregates historical data for analysis, reporting, and decision-making. Powers BI dashboards, data science.

Example: "show me total ATM withdrawals by region for last quarter"

Side-by-side comparison

AspectOLTPOLAP
PurposeDaily business operationsAnalysis and insights
Data typeCurrent, real-timeHistorical, aggregated
NormalizationHighly normalized (3NF)Denormalized (Star/Snowflake)
Operation mixINSERT, UPDATE, DELETE heavySELECT (read-only)
Query typeSimple, single-rowComplex aggregations
Query volume per querySmall (1 row to 100s)Massive (millions of rows)
ConcurrencyThousands of usersTens of users
Response timeSub-secondSeconds to minutes OK
Update frequencyContinuousBatch (nightly/hourly)
Schema designEntity-relationship (ER)Star / Snowflake
Backup criticalityCritical, frequentLess critical, periodic
Storage sizeSmaller (current data)Much larger (historical)
Typical usersCustomers, employeesAnalysts, executives

Real-world examples

OLTP examples

OLAP examples

Typical technology stack

OLTP databases

  • PostgreSQL
  • MySQL
  • Oracle Database
  • SQL Server
  • MongoDB (NoSQL OLTP)

OLAP / data warehouses

  • Snowflake
  • Google BigQuery
  • Amazon Redshift
  • Databricks (Lakehouse)
  • ClickHouse

Why we need both

Don't run analytics queries on your OLTP database — a single "SUM(amount) for the last 5 years grouped by region" can lock tables and bring down your transactional system.

Instead, the standard architecture is:

  1. OLTP database handles real-time transactions
  2. An ETL/ELT pipeline (Airflow, dbt, Fivetran) copies data nightly to the warehouse
  3. OLAP warehouse stores historical, denormalized, query-ready data
  4. BI tools (Tableau, Power BI, Looker) query the warehouse
Typical data architecture App ──► OLTP DB ──► ETL ──► OLAP Warehouse ──► BI Tools (Postgres) (Snowflake) (Tableau) ▲ │ Users
The one-line takeaway OLTP runs the business (transactions, current state, normalized). OLAP understands the business (analysis, history, denormalized). Different priorities, different schemas, different technologies.