What is DB Migration
Context
Found .sql files inside db/migrations directory of an unfamiliar repo.
What I Learned
DB Migration = “Database migrations are a way to manage incremental, reversible changes to a database schema.”
| 개념 | 의미 |
|---|---|
| Schema evolution | DB 구조가 시간에 따라 변화 |
| Migration script | 변경을 정의한 SQL |
| Versioning | 변경 순서를 관리 |
| Migration history | 어떤 migration이 적용됐는지 기록 |
| Reproducibility | 다른 환경에서 동일하게 재현 |
Note
DB structure evolves as the service goes on. Management with DB migration is essential for safety, data integrity, collaboration, environment control, reproducing DB env, rollback, cicd, etc.
우리 서비스도 이제 ByteBase 를 도입했으니 이걸 제대로 활용하는 방법을 익혀봐야겠다