System Design
4. Database FundamentalsAnimated
Relational Databases
Data stored in tables of rows and columns linked by keys.
The idea
Relational databases enforce a schema, support joins and give strong transactional guarantees (ACID).
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- client
- gateway / proxy
- service
- cache
- data store
- queue / stream
Step one: add indexes and cache.
- step:
- 1/4
- at:
- App servers
1/7
The green dot is a request moving through the system.
Step by step
- 1Define tables and relationships
- 2Insert rows that obey constraints
- 3Query with SQL and joins
- 4Transactions keep data consistent
Where it is used
Orders, payments, accounts.
Watch out for
Scaling writes beyond one machine is hard.