Design a Chat System – senior-level system design challenge

Messages and history reads grow to 10,000 a second, then New Year's midnight triples it. Keep sends fast and every message delivered within 10 seconds, within budget.

Requirements

Goal

Hold p99 latency under 300ms, error rate under 0.5%, cost under $15,000/month through every stage of the test plan, then compare your design with a reference design.

The test plan

  1. Morning: 2,000 requests per second.
  2. Evening peak: 10,000 requests per second.
  3. New Year's midnight: 30,000 requests per second.
  4. After midnight: 10,000 requests per second.

Hint

Sends and reads want different designs. Acknowledge a send as soon as it's safely on a queue and let workers write it to the message store; serve history from a cache. Writes are 40% of traffic, so the message store needs more write capacity, not just read replicas.

Solve it on the live simulator, free and in your browser.

Read the guide

More system design challenges