← ...
project 2: the fraud detection sliding window
project 2: the “fraud detection” sliding window
scenario: “we lost $50k in a chargeback scam.” you need to detect users who make >5 transactions in 10 seconds. the mission: write a stateful stream processor.
- tech: faust (python streaming) or pyspark streaming, redis.
- challenge: implement a “sliding window” aggregation.
- dev to prod:
- read from the project 1 kafka topic.
- use redis to store a rolling window of transaction counts per
user_id. - trigger an alert (print to console/slack webhook) if threshold > 5.
- prod requirement: handle “out of order” events (events arriving late).