0% completed
Read-Through vs Write-Through Cache
Read-through and write-through caching are two caching strategies used to manage how data is synchronized between a cache and a primary storage system. They play crucial roles in system performance optimization, especially in applications where data access speed is critical.
Read-Through Cache
- Definition: In a read-through cache, data is loaded into the cache on demand, typically when a read request occurs for data that is not already in the cache.
- Process:
- When a read request is made, the cache first checks if the data is available (cache hit).
.....
.....
.....
Anonymous
· 2 years ago
To make sure that cache remains consistent with storage when it updates, the corresponding cache entries must be updated or invalidated in some way to make sure data is consistent (unlike write-through cache). I don't think data consistency should listed as pro under read-through cache.
Anonymous
· 2 years ago
I'm thinking about write-through cache:
Data Consistency: Provides strong consistency between the cache and the primary storage. No Data Loss on Crash: Since data is written to the primary storage, there’s no risk of data loss if the cache fails.
What if cache write fails, ok we have DB, maybe we can fill cache-miss, but what if DB fails. I have a problem now. I need to ensure atomicity of this parallel operation. To achieve transaction on two separate systems something like Two phase commit, it would be useful to maybe add some more sugar to this.If there's no mechanism like that successful cache write could be serving wrong data, while DB is trying to be written or ultimately fails, but then needs to rollback cache. Unless we ensure some transaction across these two with "simul
Reading Progress
0%