Write-through keeps the cache and database consistent by writing to both synchronously, which makes writes as slow as the database. Write-behind takes the opposite bet: write to the cache immediately, acknowledge right away, and persist to the database asynchronously a moment later. Writes become fast because they only touch memory. The catch is that you've introduced a window where committed writes exist only in Redis, so a crash can lose them. This is the highest-performance and highest-risk caching pattern, and knowing exactly what you're trading is essential before using it.
This is part 11 of the Redis Masterclass, following read-through and write-through.
How write-behind works
In write-behind (also called write-back), a write goes to Redis and returns immediately. The database update happens separately, asynchronously, batched with other writes:
Application writes to Redis and gets an immediate acknowledgement.






