REST
An API style where everything is a resource with its own address, like /users/42, used with HTTP verbs.
Example
GET /users/42 fetches user 42 and DELETE /users/42 removes it.
Test yourself: REST
REST APIs
What's the basic unit of a REST API?
/users is 1 resource and /users/42 is user number 42 of that resource.
REST APIs
A REST response says whether it's ___ and for how long.
For example, «can be stored for 60 seconds»: the client doesn't ask again for that minute.
REST APIs
To add a new user you send ___ /users.
POST /users creates user 1,001 and the response usually carries its new id.
0/3
â–¶ PlayLessons that use it
Public and private IP
One IP outside, many inside
Load balancers
Sharing the work
Scaling
Bigger or more machines
Storage types
Where data lives
Time complexity
Count steps, not seconds
Space complexity
How much memory it asks for
Types of structures
How they relate and where they live
How numbers are stored
Negatives and decimals in binary
How letters are stored
Every letter is a number
Arrays
Adjacent cells
Linked lists
Links of a chain
Deques
In and out at both ends
Binary trees
Each node, at most 2 children
Binary search trees
Smaller on the left, larger on the right
Heaps
The smallest, always on top
Building a heap
Bottom-up is cheaper
The k largest
Keep the best without sorting everything
Selection sort
Picking the smallest, over and over
Bucket sort
Split into buckets and sort each one
Counting sort
Sorting by counting
Rebuilding a tree
Root, left and right
Tower of Hanoi
n − 1, 1 and n − 1
Solving with DP
State, transition and borders
0-1 knapsack
Take it or leave it
Unbounded knapsack and coins
Repeats are allowed
Edit distance
How many changes separate 2 words
Greedy algorithms
The best right now
Maximum product cutting
Cut into threes
Measure and optimize
Measure first
PACELC theorem
CAP plus latency
Transactions
All together or nothing
Sagas
Steps that can be undone
Consistent hashing
A ring to split the load
Database federation
Several databases that look like one
Message queues
Don't keep them waiting
Service bus (ESB)
One hub to integrate everything
Monoliths and microservices
1 block or many pieces
Microservices done right
Microservices without traps
API Gateway
1 single front door
REST APIs
Resources and verbs
GraphQL and gRPC
Other ways to talk to an API
Quadtrees
Splitting the map in 4
Circuit breaker
Cut it before everything burns
Rate limiting algorithms
5 ways to count
Virtual machines and containers
Many machines in one
Single Sign-On
One login for everything
The design steps
From data to bottlenecks
Designing WhatsApp
2 billion messages a day
