MVP:

  1. Direct
  2. channel: group
  3. multimedia msg
  4. link preview

Goal:

  1. high available
  2. High Reliable
  3. Consistent
  4. High-performance: real-time

Bonus:

Non-Goals:

Constraints

MVP:

  1. DAU: 10M
  2. peak msg: 10M * 5 * 100 / 86400 = 50k msg/s
  3. one msg 100 bytes
  4. throughput: 50k * 0.1MB -> 100MB/s
  5. storage: 100MB/s * 86400 + 10TB
  6. group chat#: 1000

Scale:

  1. QPS:
  2. Data: bandwidth for each:

  3. CPU uti rate
  4. mem uti rate
  5. disk uti rate
  6. netowork bandwidth

1000 QPS -> more than 1 server, needs partitions, 1k - 10k QPS: 1M(read-only)

Storage: 1 MySQL Server: 100GB Btree level3: 50GB, level4: TB

Architecture & Database