OLTP vs. OLAP

4 weeks ago

What’s the difference between OLTP and OLAP?

Here’s how I’d put it:

  • OLTP, online transaction processing, is a ton of small reads and writes happening one row at a time, like updating this user’s cart or inserting an order.

on the other hand,

  • OLAP, online analytical processing, is the opposite shape: a few heavy queries that scan a ton of rows but only touch a handful of columns, like averaging field tilt by team across a whole tournament.
OLTP touches one row per transaction; OLAP scans every row but only a few columns.
OLTP touches one row per transaction; OLAP scans every row but only a few columns.

My South Korea World Cup Analytics Warehouse project is OLAP end to end, about 235K match events sitting in DuckDB (and now Athena over S3 Parquet), and every query sweeps the whole table, averaging field tilt per team across the tournament, never fetching one event to update it.

Also, the Postgres schema I’m building for my team’s ETL pipeline is the OLTP side, the app reads and writes individual product records, one at a time, under multi-tenant constraints, while 12M+ rows get enriched and rescored. They are totally different.


References

[1] https://aws.amazon.com/compare/the-difference-between-olap-and-oltp/