Hi online :)
I'll wait a bit to see if Brandur (author chimes in first), otherwise happy to pile in some thoughts.
I'll wait a bit to see if Brandur (author chimes in first), otherwise happy to pile in some thoughts.
Yeah, I'm relying on transactional semantics to guarantee no contention during the lock, but the part that I'd intended as important here is really just the idea of locking the key — not the particular implementation. I think alternatively using a `FOR UPDATE` is totally plausible and likely even to be more performant than what I've written here.
Try to imagine this as more of a "ideas guide" rather than a dictation on precise implementation.