Batch & Streaming · Streaming Processing

OLTP vs OLAP

EasyOLTPOLAPwarehousetransactions

Interview question

What is the difference between OLTP and OLAP?

How to answer

The short answer

(Online Transaction Processing): systems that run the business day-to-day. Lots of small reads/writes, strict consistency, normalized schemas. Examples: order DB, payments DB.

(Online Analytical Processing): systems for analysis. Large scans, aggregations, historical trends. Columnar warehouses and lakehouses. Examples: Snowflake, BigQuery, Redshift, Databricks SQL.

Output
OLTP:  UPDATE orders SET status='paid' WHERE id=42   (point lookup)
OLAP:  SELECT day, SUM(amount) FROM fct_orders GROUP BY day  (scan + agg)

How they connect

// moves OLTP changes into OLAP models so analysts do not hammer production DBs.

Interview tip: "OLTP = run the app; OLAP = analyze the business." Mention different schemas (3NF vs star) as a follow-up.