Problem Statement
Explain how Docker volumes help persist data when containers are removed and why that matters.
Explanation
Docker volumes live outside the container’s writable layer. When you remove a container, its writable layer is lost, but data in volumes remains. That means you can update or replace containers without losing persistent data (for example databases, logs, configuration). Use volumes when you need stateful services or want to keep data outside ephemeral containers.
