Ben @benjdd.com · Oct 9

Have a row contention problem? Try slotted counters! This is a neat technique for spreading out increments across many rows to reduce contention.

8 likes 1 replies

?

Replies

Ben · Oct 9

Consider a website like YouTube, where we need to track view counts for every video. It's convenient to store this as a column in our video table, but for popular videos there will be lots of queries simultaneously attempting increments on the same row! Contention == locking == slow!