System Design
4. Database FundamentalsAnimated
SQL
The standard language for querying relational data.
The idea
SQL declares what you want, and the database decides how to fetch it.
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
Presentation tier: the browser shows the interface.
- step:
- 1/4
- at:
- Browser
1/9
The green dot is a request moving through the system.
Step by step
- 1Write a SELECT with conditions
- 2The optimiser picks a plan
- 3The engine reads data using indexes
- 4Rows are returned
Where it is used
Reporting and application queries.
Watch out for
Slow queries without indexes, and SELECT * over large tables.