A database in a container loses all its data when the container is removed, because the writable layer goes with it. A named volume is storage Docker manages separately, so data survives restarts, upgrades and replacements. Use one for databases, uploads and anything that must outlive a container. When you instead want to edit host files and see changes live in the container, a bind mount is the better fit.