KCNA · Question #109
How is application data maintained in containers?
The correct answer is D. Store data into volumes. Application data in containers is maintained using volumes, which provide a persistent and independent storage mechanism decoupled from the container's lifecycle.
Question
How is application data maintained in containers?
Options
- AStore data into data folders.
- BStore data in separate folders.
- CStore data into sidecar containers.
- DStore data into volumes.
How the community answered
(48 responses)- A2% (1)
- B4% (2)
- C2% (1)
- D92% (44)
Why each option
Application data in containers is maintained using volumes, which provide a persistent and independent storage mechanism decoupled from the container's lifecycle.
Storing data into "data folders" within the container's writable layer will result in data loss when the container is destroyed.
Storing data in "separate folders" without defining them as volumes does not guarantee persistence beyond the container's lifecycle.
Sidecar containers are used for co-located helper processes, such as logging agents or proxies, not directly for persistent application data storage.
Containers are designed to be ephemeral and stateless, meaning any data written directly inside a container's writable layer is lost when the container is removed or restarted. To maintain application data persistently, containers use volumes, which are separate storage units mounted into the container filesystem and persist beyond the container's lifecycle.
Concept tested: Container data persistence using volumes
Source: https://docs.docker.com/storage/volumes/
Topics
Community Discussion
No community discussion yet for this question.