Persistent Storage Cache Write-Back Using LRU Eviction
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing storage systems face inefficiencies in handling write requests to persistent storage devices, leading to delayed responses and increased wear on the storage media due to repeated writes.
Innovation Solution
Implementing a cache system with a least recently used (LRU) queue and non-volatile memory to store data temporarily before writing to persistent storage, allowing immediate reporting of write completion and optimizing data eviction strategies to reduce unnecessary writes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If data is written directly to persistent storage device, then data persistence is ensured, but write responsiveness is delayed and media wear increases
Solution Approach 1:
A cache memory is introduced as an intermediary between the host and persistent storage device. The cache stores write data temporarily and provides immediate write completion acknowledgment to the host, while asynchronously flushing data to persistent storage in the background. This mediator resolves the contradiction by decoupling the write speed requirement from the persistence requirement.
Solution Approach 2:
The system performs preliminary writing of data to the cache memory before committing to persistent storage. By pre-storing data in the fast cache and using write-back caching with dirty bit tracking, the system achieves immediate write responsiveness while ensuring persistence through subsequent flush operations to the storage device.
2Speed
If data is cached in memory, then write responsiveness improves, but system complexity increases
Solution Approach 1:
The cache management system operates autonomously using self-service mechanisms. The dirty bit field automatically tracks which cache lines need flushing, the LRU queue autonomously manages cache line eviction based on access patterns, and the flush operation automatically writes dirty cache lines to persistent storage without requiring complex host intervention or manual management.
Solution Approach 2:
The system changes the state parameters of cache lines (clean/dirty bits, LRU queue position) to manage cache operations. By tracking simple binary states and queue positions rather than complex metadata, the system achieves effective cache management with minimal complexity overhead.
3Reliability
If cache flush is performed frequently, then data persistence is ensured, but write amplification increases
Solution Approach 1:
Instead of continuous or frequent flushing, the system uses periodic batch flushing of dirty cache lines to persistent storage. The flush operation collects multiple dirty cache lines and writes them together in batches, reducing the frequency of flush operations and minimizing write amplification while still ensuring data persistence over time.
Solution Approach 2:
The system selectively flushes only the dirty cache lines that contain modified data, discarding the clean cache lines from the persistent storage write operation. This selective approach ensures that only necessary data is written to persistent storage, reducing write amplification while maintaining data persistence for modified data.
Data Source
AI summary
A method comprising: receiving a request to write data to a persistent storage device; writing the data to a cache line of a cache; pushing the cache line onto the end of a least recently used (LRU) queue of cache lines; and reporting the data as having been written to the persistent storage device.


