Skip to content
IT glossary
DatabasesUpdated December 3, 2026

OLAP vs OLTP

OLAP и OLTP

OLTP handles day-to-day application operations, such as placing an order or updating its status. OLAP analyzes data across many operations, such as comparing monthly sales across regions.

Also known as: OLAP, OLTP

Two kinds of database work

OLTP stands for Online Transaction Processing. It keeps an application running as users look up and change individual records. At checkout, for example, the application might create an order and reduce available stock in a single transaction. Either both changes commit or neither does. The system needs to handle many such requests concurrently without making customers wait.

OLAP stands for Online Analytical Processing. It helps people answer questions across many records: Which regions grew fastest last quarter? How did weekly sales change after a promotion? A query can scan millions of rows to produce a report with only a handful of totals.

How the workloads shape the database

  • OLTP queries usually touch little data per request. Looking up an order by its primary key or changing its shipping status is a small operation. Indexes help locate specific rows, and a normalized schema often keeps frequently updated facts from being duplicated. Row-oriented storage is a common fit when requests need several fields from a few records.
  • OLAP queries often touch many records but need only a few fields. A columnar engine can sum order amounts by region without reading shipping addresses or customer notes. Date partitioning can also help it skip periods outside the requested range. These choices reduce the amount of data the engine has to read to answer a report.

Example: checkout and reporting

An online shop might use PostgreSQL to run checkout and copy paid orders into ClickHouse for reporting. If paid_orders contains one row per order, this query reports total payments by region from January 1, 2025 onward:

SELECT region, SUM(amount) AS total_paid
FROM paid_orders
WHERE paid_at >= '2025-01-01'
GROUP BY region;

Running the report on a separate system keeps its scans from competing with checkout for CPU and storage bandwidth on the primary database. The trade-off is that the team must maintain a data pipeline and define how fresh the report needs to be. With hourly loads, a completed payment may not appear until the next load.

Common misconceptions

OLTP and OLAP describe workloads, not mutually exclusive lists of database products. PostgreSQL can run analytical queries, and a small application may serve both workloads from one database. SQL syntax does not settle the distinction either: a SELECT that fetches one order is a typical OLTP read. And online in OLAP does not guarantee that the underlying data is up to date.

How it comes up in interviews

If asked whether a sales dashboard should query the primary database, start with the workload rather than a product name. How many rows does each refresh read? How often does it run? How much lag can users tolerate? A modest report may be fine on the existing database. Frequent large scans can justify a separate analytics store, but your design should account for how changes reach it and when users will see them.