NOTE

Designing a High-Concurrency System

A historical note on scalability, service and storage scaling, and approaches for read- and write-heavy concurrency.

System DesignCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. What Is Scalability?

  • It describes a system’s ability to handle increasing load.

2. How to Design a Scalable System

  • Vertical scaling.
  • Horizontal scaling.

3. What Is High Concurrency?

  • A system with high read QPS, write QPS, or both.

4. How to Design for High Concurrency

4.1. Service-Layer Scalability

  • Make performance grow roughly linearly by adding machines: each service should be stateless, meaning there should not be business logic that must run on one specific node.
  • In other words: add machines + load balancing.

Service Scaling

4.2. Storage Scalability

4.3. High Read Concurrency

Essentially solved through the idea of replication.

4.3.1. Cache

4.3.2. Heavier Writes, Lighter Reads

  • Replace read fan-out with write fan-out.

4.3.3. Read/Write Splitting

4.4. High Write Concurrency

4.4.1. Asynchronous Processing

4.4.2. Cache + Batch Processing

4.4.3. Heavier Reads, Lighter Writes

  • Replace write fan-out with read fan-out.

5. How to Validate High Concurrency

6. References

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub