跳至主要內容

System Design – Part 2: SNAKE

If we take Netflix as an example for SNAKE princile.

Scenario:

Step 1: Enumerate

  • Register/Login
  • Play movie
  • Movie recommendation

Step 2: Prioritize

  • Play movie:
    • Get channels
    • Get movies in channels
    • Play a movie in channel

Necessary:

Step 1: Ask

What’s the target DAU? For example: 5 millions

Step 2: Predict

User:

  • Average concurrent users = daily active users / daily seconds * average oneline time
    • Average concurrent user = 5,000,000 / (24*60*60) * (30*60) = 104,167
  • Peak users = average concurrent users * 6 = 625,000
  • Max peak users in 3 months = peak users * 2 = 1,250,000

Traffic:

  • Traffic per user = 3mpbs
  • Max peak traffic 1,250,000 * 3mpbs = 3.75Tb/s

Memory:

  • Memory per user = 10KB
  • Max daily memory = 5,000,000 * 2 * 10 = 100GB

Storage:

  • Total movie = 14,000
  • Movie storage = total movie * average movie size = 14,000 * 50 GB = 700TB
    • Each movie may have different resolutions, so total can be counted around like 50GB

Application: serivce/algorithm

  • Step 1: Replay the case, add a service for each request
  • Step 2: Merge the services

Kilobit: data

  • Step 1: Append dataset for each request below a service
  • Step 2: Choose storage types

Evolve:

  • Step 1: Analyze
    • with
      • Better: constrains – catch up new constrains
      • Broader: new cases – implement new use cases
      • Deeper: details – better performance and details
    • from the views of
      • Performance
      • Scalability
      • Robustness
  • Step 2: Go back by evolving accordingly
分類:Self-learning

搶先發佈留言

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

由 Compete Themes 設計的 Author 佈景主題