Hacker News new | ask | show | jobs
by firtoz 609 days ago
AFAIK the writes and reads are done only from the same process, so the long term storage will apply only if the current process is hibernated. When you write something and then read it, it's immediate, because the writes and reads are also updating the current process's state in memory.

For another process (e.g. another DO or another worker) to access the data, they need to go through the DO which "contains" the data, so they'd be making a RPC or a HTTP request to the DO, and they'd get the latest information.

+ the hibernation happens after x seconds of inactivity, so it feels like the only time a data write to be unavailable as expected would be when the DO or worker crashes right after a write.

1 comments

You're right that reads and writes are immediate in the same client connection, this is how it works with CF KV as well - but not across the entire network.

On KV they expect up to 30 second latency before a write can be written everywhere, I expect similar here.

Cloudflare ensures all operations on a DO happen on _the_ single instance of that DO, worldwide.

There’s no such thing as the read after wrote problem because only one host will ever do reads and writes (until that host dies).

Indeed. The entire purpose of DO’s is essentially to provide the consistency guarantees that KV cannot.