Skip to content

OLTP vs OLAP

Online transaction processing (OLTP) and online analytical processing (OLAP) describe two different jobs a database can be asked to do. The distinction matters on AWS because it is the first fork in the road: transactional workloads belong on RDS or Aurora, analytical workloads on Redshift, and a database tuned for one performs badly at the other.

A relational database in this sense is the system of record for day-to-day operations. It handles real-time transactions and updates against current data.

  • Optimised for a high volume of small, fast transactions.
  • Normalised schema, which reduces redundancy and keeps writes cheap.
  • Frequent writes and updates.
  • Typically smaller data volumes.
  • Row-oriented storage — a single row is read or written as a unit.

Typical uses: customer orders, inventory management, banking transactions, user accounts, hotel and airline reservations.

A data warehouse exists to answer questions about history rather than to run the business minute to minute.

  • Optimised for complex queries over large scans.
  • Denormalised schema — often a star or snowflake schema — chosen for query speed rather than write efficiency.
  • Predominantly read operations, loaded in periodic batches.
  • Much larger data volumes, retained over years.
  • Column-oriented storage, so a query that touches three columns of a hundred reads only those three.

Typical uses: business reporting, sales trend analysis, financial forecasting, customer behaviour analysis, performance metrics.

AspectRelational database (OLTP)Data warehouse (OLAP)
Data updatesContinuous, real timePeriodic batch loads
Query typeSimple, standardised, few joinsComplex, ad hoc, many joins and aggregations
Data scopeCurrentHistorical
SizeGigabytesTerabytes to petabytes
UsersOperations staff, customers — many of themAnalysts and executives — few, each expensive
Performance measureTransactions per secondQuery response time
Data modelHighly normalisedOften denormalised
Typical operationsINSERT, UPDATE, DELETESELECT for analysis and reporting
Backup and recoveryRegular backups with point-in-time recoveryPeriodic full backups, less frequent
ConcurrencyMany concurrent short transactionsFewer queries, each consuming more resources
Data retentionCurrent data, often a rolling window of weeks or monthsYears of history

Consider a retailer. Its relational database holds current inventory, processes sales and manages customer accounts — every checkout is a transaction against it. Its data warehouse holds several years of those same sales, denormalised, and answers questions such as which product lines are seasonal, how buying behaviour differs by region, and which stores underperform comparable ones.

The two systems hold overlapping data and serve entirely different questions. That is why both exist, and why running the analytical queries against the transactional database is the mistake this distinction is meant to prevent: a long-running aggregate scan holds resources that the checkout path needs.