解説

システム設計の概念

システム設計の質問の大半の背景にある概念を、それぞれが解決する問題ごとにまとめました。1 つずつにページがあり、ゲームで試す方法も付いています。

Most system design questions come down to about fifty ideas, and each one answers a specific problem: too much traffic, data that does not fit on one machine, a dependency that fails, a number that hides the real picture. This page groups them by problem. Every entry links to a page that explains it, and most have a Component or Sandbox in Quorum where you can watch it work on live traffic.

When one server is not enough#

Start by making the app tier something you can copy. Stateless app servers keep no session in memory, so any copy can answer any request. Then several app servers behind a load balancer spread the work. The choice between vertical and horizontal scaling is a cost question, and scale up first argues that a bigger box is often the cheaper answer for longer than people expect.

Reading the same data again and again#

A cache answers repeated reads from memory so the database does not have to. Cache-aside is the default, and write-through and write-behind change when a write reaches the database. A hot key expiring can send every reader to the database at once, which cache stampede protection prevents.

When the database is the limit#

Reads and writes hit the database differently, so they scale differently. Read replicas copy the data to servers that only answer reads, and replication strategies explain what happens to a write on the way. When writes are the limit, sharding splits the data across servers, and consistent hashing decides which server owns a key without moving most keys when the set of servers changes.

When copies of the data disagree#

Once data lives in more than one place, the copies can differ for a while, and a design has to say how long that is acceptable. CAP and PACELC state the tradeoff, and consistency models list the choices from strict to eventual. Quorum reads and writes let a store pick its point on that line per request.

Work that does not need to happen now#

A queue lets a fast producer hand work to a slower consumer. Slow work to a queue and workers is the basic move, and queue load leveling shows why it smooths a spike. Publish-subscribe sends one event to many consumers, and competing consumers share one queue between many workers.

When something fails#

A slow dependency is more dangerous than a dead one, because callers wait and pile up. Timeouts bound the wait. Retry with backoff recovers from short faults, and the circuit breaker stops retries from hammering a service that is down. The bulkhead keeps one failing dependency from using every thread.

Measuring a system#

You cannot fix what you read wrongly. Percentiles, not averages shows how a mean hides the slowest users, and tail latency explains why the slowest requests dominate once a page makes many calls. Latency vs throughput and Little's law connect the two numbers.

Common questions#

What are the most important system design concepts to learn first?#

Learn load balancing, caching, replication, sharding, and queues first, because almost every interview question uses at least three of them. Add timeouts, retries, and percentiles next, since they explain why systems fail under load and how to notice it.

How do I practice system design without an interview partner?#

Build a system, put traffic through it, and see which part fails first. Quorum does this on a board: you place the Components, the Simulation sends requests through them, and each fix moves the bottleneck somewhere else, so you learn the order in which real systems break. The first bottleneck tutorial is a short start.

Is system design only for interviews?#

No. The same ideas decide whether a real service survives a launch day or a flash sale, and the incidents pages show what each one looks like when it goes wrong. Interviews test the same reasoning, with a shorter clock and less data.