Row
All the data of a single thing inside a table, like a user or an order.
Example
Signing up a new user adds 1 row: from 1,000 you go to 1,001.
Test yourself: Row
Databases
Each column holds a different type of data in each row.
It's the opposite: the 'age' column holds a number in all 1,000 rows. The value changes, not the type.
0/1
â–¶ PlayLessons that use it
What system design is
Think before you build
The OSI model
The network, in 7 layers
Load balancers
Sharing the work
Kinds of load balancers
Not all load balancers are alike
Big O notation
How much does it grow?
Iteration and recursion
2 ways to repeat
Space complexity
How much memory it asks for
Types of structures
How they relate and where they live
Basic data types
The bricks of everything
Arrays
Adjacent cells
Memory and cache
Close is fast
Deques
In and out at both ends
Hash collisions
When 2 keys want the same spot
Binary trees
Each node, at most 2 children
Trees in an array
No references, just math
AVL trees
A tree that straightens itself
Heaps
The smallest, always on top
Graphs
Points and connections
Graph operations
Adding and removing vertices and edges
Boundaries with binary search
Where to insert and where a run starts
Choosing how to search
Brute force or using the order
Selection sort
Picking the smallest, over and over
Quick sort
A pivot and 2 sides
Merge sort
Split in half and merge in order
Heap sort
Take the maximum and leave it at the end
Counting sort
Sorting by counting
Backtracking
Try, and if it fails, go back
N-queens
None attacks another
Dynamic programming
Solve each thing only once
When DP works
3 properties
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
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
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
Quadtrees
Splitting the map in 4
Circuit breaker
Cut it before everything burns
Rate limiting algorithms
5 ways to count
Designing Twitter
1 billion tweets a day
Designing Uber
10 million rides a day
