Goal - Design xxx-system

Assumptions:

  1. a
  2. b
  3. xxx

how many users: 100m active users

Functional requirements:

  1. support xx million users
  2. user to do xx action
  3. real-time (redis in memory) / offline batch
  4. message queue for transaction sequence
  5. validation / monitoring
  6. accounts registration and payments
  7. rate limit for free accounts
  8. cache
  9. multi-language support
  10. US only or across the world (tax diff, rate diff)

Non-functional requirements

  1. scalable: 100m DAU
  2. available: database shard, monitor for auto-scaling (worker pool)
  3. performance
  4. security: external/internal user? 2-facto-login, firewall, encryt/decrpyt, user-based-access-rule, Lightweight directory access protocol (LDAP)
  5. consistency: strong consistency, CAP Theorem, read-heavy/write-heavy
  6. legal compliance
  7. 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

  1. Single points of failure: LB
  2. Data replication
  3. Content Delivery Network (CDN)
  4. spike/peak of traffic
  5. Scalability: How can the system work for 10 times more people?
  6. cache: eviction policy, inconsistency

References - System Design Interview Prep

  1. Nail the System Design Interview - https://blog.tryexponent.com/how-to-nail-the-system-design-interview/
  2. How to prepare for the System Design Interview - https://www.educative.io/blog/how-to-prepare-system-design-interview
  3. 31 System Design Interview Questions - https://igotanoffer.com/blogs/tech/system-design-interviews
  4. LeetCode.ca design https://leetcode.ca/tags/#.Design
  5. 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/

.