RETURN TO SYSTEM DESIGN VAULT (55)BLUEPRINT #30 // Easy
#30EasyFinTech & Transactional APIs
Design a Price Alert System for Amazon (or for Stock prices)
ASKED IN INTERVIEWS AT:MetaBloombergCoinbaseSwyftx
EXECUTIVE SUMMARY & PROBLEM STATEMENT
Design an alert system monitoring millions of stock prices or product items, matching incoming price tick streams against user price thresholds in under 1 second.
SCALE ESTIMATION & TRAFFIC ENVELOPE
DAILY ACTIVE USERS / TPS10 Million registered alerts, 50,000 price ticks/sec during market hours
READ / WRITE TRAFFIC RATIOHeavy read evaluation against memory indices
5-YEAR STORAGE CAPACITYRedis sorted sets / Interval trees in RAM
FUNCTIONAL REQUIREMENTS
- [1]Users register target price alerts (e.g. notify if AAPL <= $170)
- [2]Evaluate price ticks against active alerts in real time
- [3]Deliver email/push notifications
NON-FUNCTIONAL REQUIREMENTS
- •Alert trigger latency < 1s from tick arrival
- •Support millions of registered alerts
- •Debounce rapid price oscillations to avoid spam
CORE ARCHITECTURAL COMPONENTS
Price Ingestion Stream (Kafka)
Memory Evaluation Engine (Interval Tree / Redis Sorted Sets)
Alert Dispatcher Queue
Notification Service
DATA SCHEMA & PERSISTENCE
Alerts: alert_id, user_id, symbol, target_price, condition (LESS_THAN, GREATER_THAN), status
DISTRIBUTED TRADE-OFFS & FAILURE MODES
- ⟡Indexing alerts by price buckets allows checking only threshold-crossing alerts instead of iterating over millions of registered triggers.