OLTP
OLTP (Online Transaction Processing) describes the class of database workloads characterised by many short-lived, latency-sensitive transactions: row-level reads and writes that back interactive applications. OLTP contrasts with OLAP (Online Analytical Processing), where queries scan large fractions of historical data for analytics.
OLTP characteristics
- Short transactions. A few row reads and writes; complete in milliseconds.
- High concurrency. Thousands to hundreds of thousands of transactions per second.
- Row-oriented storage. Optimised for fetching whole rows quickly.
- ACID guarantees. Atomicity and isolation matter for business correctness.
- Strict latency SLAs. User-facing requests demand p99 latency targets.
OLTP vs OLAP
| OLTP | OLAP | |
|---|---|---|
| Workload | Many small reads/writes | Few large scans and aggregations |
| Storage | Row-oriented | Column-oriented |
| Latency | Milliseconds | Seconds to minutes |
| Examples | PostgreSQL, MySQL, DynamoDB | BigQuery, Snowflake, Redshift, ClickHouse, DuckDB |
Modern HTAP (Hybrid Transactional/Analytical Processing) systems like TiDB and SingleStore aim to serve both workloads from one engine.