Server
A computer that's always on, waiting for requests from others (the clients) and answering them.
Example
When you open a page, your phone asks a server for the data, and the server sends it in about 100 ms.
Lessons that use it
What system design is
Think before you build
What an IP is
Every machine has an address
Public and private IP
One IP outside, many inside
Static and dynamic IP
Does it change or not?
The OSI model
The network, in 7 layers
TCP and UDP
Safe or fast
How DNS works
The internet's phone book
DNS records
Each domain's instructions
Load balancers
Sharing the work
Kinds of load balancers
Not all load balancers are alike
Clusters
Many machines, one system
Evicting and spreading the cache
The cache fills up
CDN
Content close to every user
Proxies
A middleman in between
Availability
Counting the nines
Scaling
Bigger or more machines
Storage types
Where data lives
Measuring efficiency
Fast and light on memory
Queues
First in, first out
Databases
Where data is kept
SQL databases
Tables that relate
NoSQL databases
Beyond tables
SQL or NoSQL
Picking the right database
Replication
Copies of the database
Measure and optimize
Measure first
ACID and BASE
Two promises about data
CAP theorem
Pick 2 of 3
Transactions
All together or nothing
Distributed transactions
Everyone commits or nobody does
Sharding
Splitting the database into pieces
Consistent hashing
A ring to split the load
Database federation
Several databases that look like one
N-tier architecture
An app in floors
Message brokers
A middleman for messages
Message queues
Don't keep them waiting
Publish-subscribe
1 message, many listeners
Service bus (ESB)
One hub to integrate everything
Monoliths and microservices
1 block or many pieces
Microservices done right
Microservices without traps
Event-driven architecture
Announcing what happened
REST APIs
Resources and verbs
GraphQL and gRPC
Other ways to talk to an API
Real time: long polling, WebSockets and SSE
Letting the server speak first
Rate limiting
A cap on requests
Idempotency
Repeat without breaking anything
Service discovery
Where is that service?
SLA, SLO and SLI
Promise, target and measure
Disaster recovery
Running again after the disaster
Virtual machines and containers
Many machines in one
OAuth 2.0 and OpenID Connect
Grant access without giving the password
SSL, TLS and mTLS
Talk without anyone listening
Requirements and estimates
Ask before you draw
The design steps
From data to bottlenecks
Designing a URL shortener
A long link in 7 characters
Generating unique keys
Where 3I71d3o comes from
Designing WhatsApp
2 billion messages a day
Designing Netflix
1 billion videos watched a day
Designing Uber
10 million rides a day
