Database
A program that stores data in an orderly way and lets you find, change and delete it.
Example
A store's database keeps 1 million orders and finds yours in under 10 ms.
Test yourself: Database
Databases
What is a database?
A store keeps 1 million orders in its database and finds yours in under 10 ms.
0/1
â–¶ PlayLessons that use it
What system design is
Think before you build
Kinds of load balancers
Not all load balancers are alike
Clusters
Many machines, one system
Cache
What's asked often, close at hand
Evicting and spreading the cache
The cache fills up
Availability
Counting the nines
Scaling
Bigger or more machines
Storage types
Where data lives
Big O notation
How much does it grow?
Space complexity
How much memory it asks for
Hash algorithms
A good hash spreads evenly
AVL trees
A tree that straightens itself
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
Dense and sparse indexes
The book's index
Normalize and denormalize
Each piece of data in one place
ACID and BASE
Two promises about data
CAP theorem
Pick 2 of 3
PACELC theorem
CAP plus latency
Transactions
All together or nothing
Distributed transactions
Everyone commits or nobody does
Sagas
Steps that can be undone
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
Monoliths and microservices
1 block or many pieces
Microservices done right
Microservices without traps
Event sourcing
Keep the story, not just the ending
REST APIs
Resources and verbs
Geohashing
A place in a few letters
Idempotency
Repeat without breaking anything
Service discovery
Where is that service?
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 Twitter
1 billion tweets a day
