Nobody hurts a payments database with fraud checks. They hurt it with the month-end revenue dashboard.
Postgres is a row store, built for OLTP. All 8 columns of a payment sit together on disk. To SUM one column it reads all 8. 7 are waste. And that scan fights your checkout path for the same disk.
DuckDB and BigQuery are column stores, built for OLAP. Each column sits together on disk. The same query reads 2 columns and skips 6.
Flip the query and the winner flips. Fetch one payment by id: the row store answers in one index hop. The column store stitches the row back from every segment.
That is the whole split. OLTP fetches rows: payments, orders, logins. OLAP scans columns: reports, dashboards, analytics. Each cheap on one layout, expensive on the other.
#SystemDesign #PostgreSQL #DataEngineering #Databases