System Design Patterns: From Fundamentals to Real Systems
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. Which now means 12,000 UPDATEs per second... on the same row. Databases protect a row being written with a lock, so those updates form a queue, single file, each waiting for the last. The row becomes a turnstile at a stadium exit
.....
.....
.....
Like the course? Get enrolled and start learning!