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.
3 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.

@Transactional(readOnly = true) is supposed to speed Spring up by turning off dirty checking. Elastic APM showed extra JDBC calls that made it slower.