Persistence
Database containers need durable storage because the data matters more than the container itself.
This page explains why databases must be treated more carefully than simple stateless app containers.
Database containers need durable storage because the data matters more than the container itself.
Databases often start more slowly than apps, so connection timing and health checks matter.
Volumes help persistence, but proper backups and migration planning are still separate responsibilities.
services:
app:
db:
volumes:
db_data:
This structure shows the database as its own service plus a dedicated named volume for persistence.
A database is not only “running software.” It also holds a changing structure of tables and data, so deployment needs schema awareness too.
Next page: Lesson 22 explains how Docker becomes part of automated CI/CD pipelines.