hard🏗️ System Design
Design a real-time supply chain visibility platform for a Fortune 500.
A Fortune 500 retailer wants a platform that gives their ops team live visibility into inventory levels, shipment status, and supplier delays — across 500 warehouses globally.
**Requirements:**
- < 5 min data freshness for shipment events
- 10,000 concurrent users (ops analysts)
- Support for 50+ ERP and WMS integrations
- Alerting when KPIs breach thresholds
**Design the system.**
💡 Hints (3)
- 1.Start with data ingestion — how do you pull from 50+ heterogeneous sources?
- 2.Think about the read vs write path separately.
- 3.Consider eventual consistency trade-offs for real-time vs batch.
✅ View Solution
**High-level architecture:**
1. **Ingestion layer** — Kafka + connector framework (Kafka Connect or custom adapters per ERP). Events normalized into a canonical schema.
2. **Stream processing** — Flink or Spark Streaming for real-time aggregation.
3. **Storage** — TimescaleDB or ClickHouse for time-series analytics; Redis for hot KPI snapshots.
4. **API layer** — GraphQL subscriptions for live dashboard updates.
5. **Alerting** — Rules engine triggers on threshold breach → PagerDuty / Slack.
**Trade-offs to discuss:** pull vs push for ERP integration, cost of Kafka at scale, latency vs consistency.