Write-behind caching stores every change in the cache immediately, then propagates it to backing storage only at specified times or when conditions occur, such as a read. The cache stays fresh while the database may remain stale. section 7.6
Choose this policy when the performance benefits justify delayed persistence:
- Reduce write latency and database load by avoiding an immediate backing-store update. section 7.6
- Accept that backing storage can be stale and that changes may be lost if an entry is never written back. section 7.6
- Contrast it with write-through, which updates the cache and backing storage together and therefore trades speed for lower loss risk. section 7.6
Updating on a later read
A cache placed before a database can accept a changed value immediately and update the database only when another client requests that entry. If nobody reads it afterward, the database may never receive the change. section 7.6
