OLTP is a database workload profile for systems where every user operation immediately and reliably changes data: online shops, banks, taxi services, billing. The system lives as long as the stream of such operations flows, so it is expected to respond quickly and keep strict integrity — money and orders must not be lost or duplicated.
How OLTP differs from OLAP
The term is almost always mentioned alongside OLAP: the same organisation stores data both for running the business “now” and for analysing “years of history”, but the workloads behind these tasks are opposites.
| Property | OLTP | OLAP |
|---|---|---|
| Workload | many short transactions: inserting and updating individual rows | a few long queries over millions of rows |
| Schema | normalised, no duplication on write | star schema, built for aggregations |
| Data | current state, row storage | years of history, often columnar storage |
| Response | fast: the result is needed at once | long queries are acceptable |
| Example | a money transfer, placing an order | revenue by region for a quarter |
What matters for an OLTP system
- ACID transaction properties: a transfer is either applied in full or rolled back — there will be no double charge.
- Indexes for point queries: a lookup by key must find the row quickly rather than scan the table.
- Concurrency: many simultaneous sessions, hence row-level locks and row versions instead of locking the whole table.
- Row storage: the whole row sits together so that reading and updating a record is a single operation.
- Write scaling: replication takes the read load off, and sharding spreads data across nodes when a single server cannot cope.
The transactions themselves stay short: each operation is wrapped in one small transaction. A long yearly sales report running on the same database gets in the way of orders, so such queries are usually moved to a separate data mart or data warehouse.
Sources
the term is written from these pages- Microsoft Learn — Online transaction processing (OLTP)learn.microsoft.com/en-us/azure/architecture/data-guide/relational-data/online-transaction-processing(opens in a new tab)
- Oracle Documentation — Differences between OLTP and data warehousing environmentsdocs.oracle.com/cd/B19306_01/server.102/b14223/concept.htm(opens in a new tab)
Verified 18 Nov