OLTP vs OLAP
People think OLTP and OLAP are two brands of database. They are two kinds of work. OLTP is many tiny reads and writes, such as placing an order. OLAP is a few huge queries that add up millions of rows, such as sales by month. A system built for one is slow at the other.
Online Transaction Processing (OLTP)
Many small, fast reads and writes. It is the work behind an app.
OLTP is the kind of work an app's database does all day. It runs many small reads and writes, each touching just a few rows. Placing an order or changing a password are OLTP tasks. Each one must be quick and must not get lost. These databases usually store data row by row.
Online Analytical Processing (OLAP)
Big queries that add up lots of rows. It is the work behind reports.
OLAP is the kind of work done to answer questions about lots of data. A query reads millions of rows but only a few columns. It adds up, counts and groups them, such as sales by month and region. These queries are fewer than OLTP ones, but each is much bigger. Systems built for OLAP usually store data column by column.
In one line
- Online Transaction Processing (OLTP)
- Many small, fast reads and writes. It is the work behind an app.
- Online Analytical Processing (OLAP)
- Big queries that add up lots of rows. It is the work behind reports.