Understanding Pessimistic Locks Through a Like Feature
Like-button races, solved with database locks. How pessimistic locking works, and how next-key locks slow the check for whether a review was already liked.
2 posts

Like-button races, solved with database locks. How pessimistic locking works, and how next-key locks slow the check for whether a review was already liked.

1,000 people request 100 items at once. How a single UPDATE gives one to exactly 100 of them, instead of the locks usually proposed for a first-come event.