System Design
4. Database FundamentalsAnimated
Database Migrations
Controlled, versioned changes to the schema.
The idea
Migrations are scripts applied in order so every environment has the same schema, and they can be rolled forward safely.
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
Describe infrastructure as code in Git.
- step:
- 1/4
- at:
- Developer
1/8
The green dot is a request moving through the system.
Step by step
- 1Write a versioned migration
- 2Apply it in staging
- 3Deploy compatible code
- 4Apply in production
Where it is used
Evolving databases.
Watch out for
Locking large tables. Use expand and contract steps.