Stream the transactions through Kafka into a stream processor that pre-aggregates into an OLAP store, so dashboards read tiny pre-computed rollups instead of scanning raw events. At millions of txns/day you never run SUM() over the raw table on each page load — you aggregate once, on write.
Architecture
Payment svc ──▶ Kafka topic ──▶ Flink/Kafka Streams ──┬─▶ OLAP (ClickHouse/Druid) ◀── Dashboard
(txn events) (buffer,replay) (windowed pre-agg) │ (per-minute rollups) (read)
└─▶ S3/Parquet (raw, replay/audit)
state store ◀──────────┘ (exactly-once checkpoints)
