System Design Principles
System Design Principles
Interview Framework
Step 1 10 min. Step 2 10 min. Step 3 10 min. Step 4 10 min. Step 5 5 min.
API
Understand the Problem High-Level Design Deep-Dive Improve the Design Wrap Up
Gather more information Explain how each part of the Examine system components Take a step back. What are Summarize the requirements,
about the system system works together.
in detail. Your interviewer the bottlenecks? How does it justify your decisions,
requirements and Start by defining APIs.
may pick a specific area or scale? suggest alternatives, and
constraints. They are the foundation of ask you what you’d like to answer any questions.
the architecture. explore.
resource-
action-oriented single endpoint
oriented high performance strongly-typed
data-driven requests
Properties flexible no data
Async Messaging Message Message
overfetching Queue
self-documenting HTTP sync
Service
ProducerA Service B
Consumer
Client Producer Subscribe Consumer
Data JSON, XML, YAML,
JSON, XML, Thrift,
JSON
HTML, plain text Protobuf, FlatButters
web-based apps complex
high-
cloud apps microservices
performance
Publish
system mobile apps Publish-Subscribe Topic Subscribe
Use cases client-server apps IoT applications complex systems
Subscribe
cloud computing
and microservice-
Scalability Caching
Consider the scale of your system. How many users and requests will the server support? What happens In-memory Cache Distributed Cache
with increased demand?
Replication Partitioning
Is the data important enough to make copies? Partitions contain a subset of the whole table.
How important is it to keep all copies the same? Each partition is stored on a separate server.
Sharing data / Сonsistency
Upload
Load
Processor Popular caches
Service Balancer In-memor Storing user session
Communication
Redi
Shard 1 Shard 2 Shard 3 Shard 4 Image
Memcache between microservice
Processor Caching frequent
2516
2516
2516
2516