Container Root File System Overlay for Persistent Write Layers
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing container technologies lose data written in the read-write layer when restarted, affecting the normal operation of applications due to the stateless design, particularly for rich container applications that are not fully containerized.
Innovation Solution
Separate the read-write layer of the container root file system from the image read-only layer by using a local directory on the host, implementing data persistence by mounting the layers through an overlay mechanism.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the container uses a traditional root file system created from container image, then the container can be lightweight and portable, but the data in the read-write layer will be lost when the container is restarted
Solution Approach 1:
The patent segments the container root file system into two independent layers: a read-only layer (from container image) and a read-write layer (local directory on host). This segmentation allows each layer to have its own characteristics - the read-only layer maintains portability while the read-write layer ensures data persistence, resolving the contradiction between reliability and traditional container structure.
Solution Approach 2:
The patent merges the read-only layer and read-write layer into a unified container root file system using overlay mounting. This combining allows the container to function as a single integrated system while maintaining the benefits of both layers - the immutability and portability of the image-based layer and the persistence of the host-based layer.
2Reliability
If the container read-write layer is separated from the image read-only layer using a local directory on host, then data persistence is achieved, but the container structure becomes more complex
Solution Approach 1:
The patent introduces an overlay mounting mechanism as an intermediary between the read-only layer and read-write layer. This mediator combines the two layers into a unified view for the container while maintaining their individual characteristics, achieving data persistence without requiring complex application-level implementation.
3Adaptability or versatility
If the container is designed as stateless, then the container can be easily restarted and migrated, but applications require data persistence to function normally
Solution Approach 1:
The patent segments the file system into read-only and read-write layers, allowing the read-only layer to be portable and easily migrated while the read-write layer provides persistent storage for application data. This segmentation enables both stateless container characteristics and stateful application requirements to coexist.
Solution Approach 2:
The patent applies different qualities to different parts of the file system - the read-only layer maintains the immutable, portable characteristics needed for container migration, while the read-write layer provides persistent storage characteristics needed for application functionality. Each layer has optimized properties for its specific purpose.
Data Source
AI summary
The present application discloses a container-based read/write control method and apparatus, and a device, which are used to solve a technical problem of data loss after a container is restarted in a container root file system. The method includes: creating an original container root file system according to a container image in response to a start of a container, where the original container root file system includes an original image read-only layer and an original container read-write layer; creating a local directory on a host; and using the original container root file system as an image read-only layer of a container root file system, using the local directory as a container read-write layer of the container root file system, and generating the container root file system.


