- Goal - Design xxx-system
- Assumptions:
- how many users: 100m active users
- Functional requirements:
- Non-functional requirements
- Load calculation
- Bottleneck
- References - System Design Interview Prep
Goal - Design xxx-system
Assumptions:
- a
- b
- xxx
how many users: 100m active users
Functional requirements:
- support xx million users
- user to do xx action
- real-time (redis in memory) / offline batch
- message queue for transaction sequence
- validation / monitoring
- accounts registration and payments
- rate limit for free accounts
- cache
- multi-language support
- US only or across the world (tax diff, rate diff)
Non-functional requirements
- scalable: 100m DAU
- available: database shard, monitor for auto-scaling (worker pool)
- performance
- security: external/internal user? 2-facto-login, firewall, encryt/decrpyt, user-based-access-rule, Lightweight directory access protocol (LDAP)
- consistency: strong consistency, CAP Theorem, read-heavy/write-heavy
- legal compliance
- cost
Load calculation
Avg Load:
100m * 20 days * 100 msg/day / (30 * 24 * 60 * 60) = 66k quest-per-second (QPS)
Peak load, 3 * avg load: 200k QPS
Bottleneck
- Single points of failure: LB
- Data replication
- Content Delivery Network (CDN)
- spike/peak of traffic
- Scalability: How can the system work for
10 times
more people? - cache: eviction policy, inconsistency
References - System Design Interview Prep
- Nail the System Design Interview - https://blog.tryexponent.com/how-to-nail-the-system-design-interview/
- How to prepare for the System Design Interview - https://www.educative.io/blog/how-to-prepare-system-design-interview
- 31 System Design Interview Questions - https://igotanoffer.com/blogs/tech/system-design-interviews
- LeetCode.ca design https://leetcode.ca/tags/#.Design
- design summary https://darktiantian.github.io/LeetCode%E7%AE%97%E6%B3%95%E9%A2%98%E6%95%B4%E7%90%86%EF%BC%88%E8%AE%BE%E8%AE%A1%E7%AF%87%EF%BC%89Design/
.