3 · IN PROGRESS · BOUNDARY
PostgreSQL or ClickHouse
DATA
WHERE
WHY
players, wallets, purchases
PostgreSQL
Money and Assets: Transactions, FK, UNIQUE, Frequent UPDATES
matches, match_participants
PG + copy
Source: PostgreSQL; in ClickHouse for reporting
match events, telemetry
ClickHouse
Millions of rows are being added; aggregates by period
DAU, retention, funnels
ClickHouse (MV)
Pre-aggregation, approximate functions, dashboards
An argument that doesn't count
"ClickHouse, because it's faster."
With 50 matches per day, PostgreSQL with an index will calculate the DAU in milliseconds. We need the daily event volume, query frequency and type, acceptable latency, and the following metrics: EXPLAIN ANALYZE in PostgreSQL versus EXPLAIN ESTIMATE and query time in ClickHouse.
"Analytics remain in PostgreSQL for up to N events per day." As in Lesson 3: a solution plus a measurable condition for review.