System Design Patterns: From Fundamentals to Real Systems
Vote
0% completed
Write-Behind
1. The Incident
Product asks for a small feature: a view counter on every product page. "12,483 people viewed this today." One line of UI. You ship it the obvious way. Every page view runs UPDATE products SET views = views + 1.
At peak, the bestseller gets 12,000 views per second. That now means 12,000 UPDATEs per second, all on the same row. Databases protect a row being written with a lock. So those updates form a queue, one behind another, each waiting for the last.
Latency on that update climbs past a second. Connections pile up waiting for their turn
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%