4 ms·
I love it and want to use it, but two announcements of a new cloud hosted distributed DB and no mention of how consistency works or how conflicts are handled wo
by skrebbel 8y ago
I love it and want to use it, but two announcements of a new cloud hosted distributed DB and no mention of how consistency works or how conflicts are handled worries me a bit.
Maybe one of the cloudflare people that read HN can shed some light on this? What happens when I write to the same key simultaneously from multiple workers and/or multiple edge nodes?
- kentonv 8y ago> What happens when I write to the same key simultaneously from multiple workers and/or multiple edge nodes? It's eventually-consistent. Eventually, one of the writes "wins". If you do a read/modify/write in the context of processing a single request from a Worker, we'll automatically apply optimistic concurrency so that the write fails if another write has occurred on the same key concurrently. But otherwise, yes, the ability to handle transactions is limited. For now, Workers KV can be used for a variety of use cases but is not a full replacement for a database. Workers KV is only the first of multiple storage-related projects we're working on. Stay tuned. :)
- kloepper 8y agoHi skrebbel, storage is my project at Cloudflare. Last write wins, for some definition of last (https://en.wikipedia.org/wiki/Eventual_consistency https://en.wikipedia.org/wiki/Eventual_consistency). As we see how initial developers make use of the storage, we are planning to add additional synchronization and consistency functionality. For example the ETags model using If-None-Match and If-Match would be appealing to some.
- aaaaaaaaaab 8y agoThey write it in the description: eventual consistency with global consistency within 10 sec.
- zzzcpan 8y agoThat's rather vague definition. And is also wrong. They obviously can't guarantee global consistency within 10 sec, as that would require consensus which is impossible to guarantee in bounded time and they probably don't even use any consensus algorithm at all, as that would be pointless for a CDN.
- kentonv 8y agoYes, in the presences of a network partition, propagation can take arbitrarily long. But, that would be classified as an outage. Knowing the typical non-outage delay is useful.