transactions को Kafka के ज़रिए एक stream processor में stream करें जो एक OLAP store में pre-aggregate करता है, ताकि dashboards raw events scan करने के बजाय छोटे pre-computed rollups पढ़ें। लाखों txns/दिन पर आप कभी हर page load पर raw table पर SUM() नहीं चलाते — आप एक बार, write पर aggregate करते हैं।
आर्किटेक्चर
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)
