Practice this topic in a realistic system design interview
Write-through caching waits for the database before telling the application that a write succeeded. That keeps the write path simple, but every write pays the full database cost.
Write-behind caching, also called write-back caching, changes that contract. The cache accepts the write quickly, tells the application the write succeeded, and writes it to the database later from a background worker.
This can make writes feel much faster and smooth out traffic spikes. But it also creates a risky window: the application thinks the write is saved, while the database does not have it yet.
Write-behind is not a free performance upgrade. It is a delayed write pipeline, and it has to be designed carefully. This chapter walks through how write-behind works, where data can be lost, batching and merging writes, ordering and retries, when the pattern is safe, and what to monitor in production.