BL#1: Concurrency and Locking
Hey,
I've just published a new blog post, discussing problems and tradeoffs related to Optimistic and Pessimistic Locking. Especially, what might happen if we don't lock properly; well, usually, lost data (updates), money and confused users. Not good!
Thankfully, both strategies of locking have pretty good support in most popular languages and ecosystems; there is no excuse in not using them :)
Another interesting thing I've come to realize is that we might easily emulate Optimistic Locking behavior with FOR UPDATE NOWAIT and FOR UPDATE SKIP LOCKED SQL clauses.
You can read the whole post here: https://binaryigor.com/optimistic-vs-pessimistic-locking.html
Hope you enjoy it and see you in the next entry!
Igor
Don't miss what's next. Subscribe to Binary Log: