Clickstream personalization
Behavioral events flow through session windows into a feature store and top-K sketches — recommendations served in milliseconds from state computed in-stream.
What this design does
Event-carried state transfer in action: click events carry everything consumers need, a sessionizer closes sessions on inactivity gaps, features land in a dual-path store (stream-fresh online, batch-corrected offline), and heavy-hitter sketches keep trending-now bounded in memory. The recs API never computes anything at request time — it just reads.
The patterns it composes
- Event-carried state transfer — events carry full context; consumers build views without callbacks
- Session windows — sessions close on a 30-min inactivity gap, not fixed clocks
- Feature store — online (ms reads) + offline (training) from one definition — no skew
- Top-K / heavy hitters — trending items via count-min sketch — bounded memory, any traffic
- Cache-aside — hot user features cached next to the recs API
Import it, attach your own numbers, and verify the design against failures — or read the engineering notes.