2 ms·
For anyone curious about this, it probably all comes down to an atomic compare and swap request: https://en.wikipedia.org/wiki/Compare-and-swap https://en.wiki
by zackmorris 8y ago
For anyone curious about this, it probably all comes down to an atomic compare and swap request:
https://en.wikipedia.org/wiki/Compare-and-swap https://en.wikipedia.org/wiki/Compare-and-swap
It might be straightforward to do this with an ETag like Firebase:
https://firebase.googleblog.com/2017/07/introducing-conditional-rest-requests.html https://firebase.googleblog.com/2017/07/introducing-conditio...
Not sure what this would require on their backend though.
- kentonv 8y agoYes, you'll be able to use etags with if-match for optimistic concurrency. When reading and writing from a Worker, if you do a get() followed by a put() on the same key in the context of the same request, we'll take care of the if-match automatically under the hood, so the put() fails if there was a concurrent write. (This logic is not quite in production yet but should be within a week or two.)