Write-through- Write is done synchronously both to the cache and to the backing store. Write-back (or Write-behind) – Writing is done only to the cache. A modified cache block is written back to the store, just before it is replaced. Write-through(直寫模式)在數(shù)據(jù)更新時,同時寫入緩存Cache和后端存儲。此模式的優(yōu)點是操作簡單;缺點是因為數(shù)據(jù)修改需要同時寫入存儲,數(shù)據(jù)寫入速度較慢。
Write allocate (aka Fetch on write) – Datum at the missed-write location is loaded to cache, followed by a write-hit operation. In this approach, write misses are similar to read-misses. No-write allocate (aka Write-no-allocate, Write around) – Datum at the missed-write location is not loaded to cache, and is written directly to the backing store. In this approach, actually only system reads are being cached. Write allocate方式將寫入位置讀入緩存,然后采用write-hit(緩存命中寫入)操作。寫缺失操作與讀缺失操作類似。