System Design
4. Database FundamentalsAnimated
Stored Procedures
Code stored and executed inside the database.
The idea
Procedures run close to the data, reducing round trips and centralising logic.
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
- 1Define the procedure
- 2Application calls it with parameters
- 3The database runs the logic
- 4Results return
Where it is used
Batch operations.
Watch out for
Business logic hidden in the database is hard to test and version.