Table
Holds data about one kind of thing, organized in columns and rows, like a spreadsheet.
Example
The users table has 1,000 rows, one per user, and 3 columns: id, name and age.
Test yourself: Table
Databases
A table can have from 2 to over 100 ___.
A simple table has 2 columns (id and name); a products table can have 120.
0/1
â–¶ PlayLessons that use it
Static and dynamic IP
Does it change or not?
Load balancers
Sharing the work
Clusters
Many machines, one system
Scaling
Bigger or more machines
Big O notation
How much does it grow?
Iteration and recursion
2 ways to repeat
Time complexity
Count steps, not seconds
Space complexity
How much memory it asks for
Basic data types
The bricks of everything
How letters are stored
Every letter is a number
Arrays
Adjacent cells
Deques
In and out at both ends
Hash tables
From key to slot in 1 calculation
Hash collisions
When 2 keys want the same spot
Hash algorithms
A good hash spreads evenly
Graphs
Points and connections
Graph operations
Adding and removing vertices and edges
Boundaries with binary search
Where to insert and where a run starts
Searching with a hash
From O(n²) to O(n) with a table
Choosing how to search
Brute force or using the order
What makes a good sort
5 things you ask of it
Selection sort
Picking the smallest, over and over
Bucket sort
Split into buckets and sort each one
Rebuilding a tree
Root, left and right
Tower of Hanoi
n − 1, 1 and n − 1
N-queens
None attacks another
Dynamic programming
Solve each thing only once
Solving with DP
State, transition and borders
0-1 knapsack
Take it or leave it
Edit distance
How many changes separate 2 words
Greedy algorithms
The best right now
Databases
Where data is kept
SQL databases
Tables that relate
NoSQL databases
Beyond tables
SQL or NoSQL
Picking the right database
Measure and optimize
Measure first
Dense and sparse indexes
The book's index
Normalize and denormalize
Each piece of data in one place
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 queues
Don't keep them waiting
Microservices done right
Microservices without traps
Event sourcing
Keep the story, not just the ending
CQRS
Write on one side, read on the other
API Gateway
1 single front door
Idempotency
Repeat without breaking anything
Virtual machines and containers
Many machines in one
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
Designing Netflix
1 billion videos watched a day
