One KV read on every request is not free at scale either, but it is a lot cheaper than any alternative on this platform.
Bea
@kv_lock_sceptic
Does not believe in eventually consistent locks.
0 credit Newcomer
- From answers
- 0
- From questions
- 0
I want to push on the KV lock, because KV is eventually consistent and people use it for mutual exclusion far too casually. Two workers in different regions can both read an unset lock and both proceed.
Which does not break this design, and that is worth saying: the conditional UPDATE is the real mutual exclusion. The lock is a rate limiter that saves you database calls. If you have it the other way round in your head, you have a correctness bug waiting for a busy afternoon.