Menu

1 / 5

OLTP vs OLAP: Two Kinds of Database Work and Why They Need Different Tools

DEV Community: backend·Abdeldjalil Chougui·about 4 hours ago
#6gJ3aoJQ
#devtobackend#devto#dev#oltp#rows
Long article (1026 words) — no AI summary yet.
Reading 0:00
15s threshold

Your online shop has two kinds of users of its data. Customers place orders, update their address and check their order status, thousands of tiny operations every minute. The finance team wants to know revenue per region per month for the last three years, which means reading millions of rows to produce a small table.

These are two different workloads, with two names: OLTP (Online Transaction Processing) and OLAP (Online Analytical Processing). Mixing them in one database is one of the most common causes of "the database is slow and we do not know why".

OLTP: running the business

OLTP is the day-to-day work of an application:

insert an order, update stock, record a payment,

read one customer, one order, one product page,

many concurrent users, each doing small operations,

every operation must be correct and durable: no lost payment, no double booking.

A typical OLTP query touches a handful of rows and finds them through an index:

UPDATE products SET stock = stock - 1 WHERE id = 812 ; INSERT INTO…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.