1 · INTERNALS · LOAD
OLTP vs. OLAP
OLTP — a gaming service
OLAP — Analytics
-- покупка: две строки, одна транзакция
BEGIN;
UPDATE wallets SET gold = gold - 100
WHERE player_id = 1042;
INSERT INTO purchases (player_id, item_id, price_paid)
VALUES (1042, 'sword_dawn', 100);
COMMIT;
-- DAU по режимам за сентябрь
SELECT toDate(ts) AS day, mode,
uniq(player_id) AS dau
FROM events
WHERE ts >= '2026-09-01' AND ts < '2026-10-01'
GROUP BY day, mode
ORDER BY day;
Many short queries, reading and updating rows by key, FK, CHECK, transactions.
There are few queries; each reads millions of rows, but only 3 out of 30 columns. Data is being appended.
Who's asking?
How much data?
Question about the slide
Game Designer, Analyst, LiveOps: How many players have reached Level 5, where the tutorial ends?
10,000 players per day × 2,000 events per session = 20 million rows per day.
Why not do the same calculation in PostgreSQL?