categories.warehouse-modeling Basic
OLAP vs OLTP: Analytical vs Transactional Databases
Explain the difference between OLAP and OLTP.
OLTP (Online Transaction Processing)
Designed for day-to-day business transactions (orders, logins, updates).
Characteristics:
- High-frequency, short read/write operations.
- Strict ACID transaction guarantees.
- Each operation touches few rows (a single order).
- Normalized schema (minimize data duplication).
Examples: PostgreSQL, MySQL, Oracle
OLAP (Online Analytical Processing)
Designed for complex analytical queries over large datasets (monthly sales reports, user behavior analysis).
Characteristics:
- Low-frequency, long-running queries.
- Each query may scan millions of rows.
- Primarily reads; writes are usually batch loads.
- Denormalized schema (star schema) to reduce JOINs.
- Columnar storage improves aggregation performance.
Examples: Snowflake, BigQuery, Redshift, ClickHouse
Why Separate Them
Mixing them causes analytical queries to degrade the transactional system. ETL/ELT pipelines copy OLTP data to OLAP systems.
✦ AI Mock Interview
Type your answer and get instant AI feedback
Sign in to use AI scoring
