Problem regarding Write-Through and Write-Back Caches.
What is the difference between Write – Through and Write – Back Caches?
Can you explain advantages and disadvantages of each.
What is the difference between Write – Through and Write – Back Caches?
Can you explain advantages and disadvantages of each.
These are the following differences:
A cache is a block of memory in the computer that stores data temporarily for a faster data transfer. If the requested data is present in the cache, the data is served much faster by simply reading it from the cache and it is what they call “cache hit”. It is termed as hit because the data was found in the cache. But, on the contrary, not all data requests are present in the cache. Most of the time when you do multi-tasking where you open and close several applications the data request is not present in the cache.
When this happens, the data will be fetched directly from the original source which is from the hard drive and then finally served and this slows the process. This is what they call “cache miss” because the data is missing from the cache. The manner of writing data to the cache is controlled by write policy. When the system writes data to the cache, the data must also be written to the backing store at some point and this is what the write policy is handling. Write-through and write-back [write-behind] are the 2 fundamental methods of writing.
In write-through, data is written both to the cache and to the backing store simultaneously. In write-back, data is written only to the cache at the start. Data is not yet written to the backing store. It will wait for the time when the cache blocks that contains the data is about to be modified or be replaced by new content.