Live data from Hacker News

Workers Durable Objects Beta: A New Approach to Stateful Serverless

blog.cloudflare.com

11–20 of 98 posts

Re: Workers Durable Objects Beta: A New Approach to Stateful Serverless

#11
Is there only a single instance of the example Counter object globally and as there are no additional await'ed calls between the get and put operations, the atomicity is guaranteed? Is the object then prevented from getting instantiated on any other worker?

Can this result in a deadlock if I access DurableClass(1), then delayed DurableClass(2) in one worker and DurableClass(2) and delayed DurableClass(1) in another worker?

Re: Workers Durable Objects Beta: A New Approach to Stateful Serverless

#12
post #10

How would you debug and upgrade your durable objects?

This is a great question, and explains why we decided that the durable storage API needed to be explicit, rather than automatically serializing the in-memory object. Nothing is stored unless you explicitly use storage.put(key, value).

Since the storage is explicit, it's easy to upgrade the class definition. The in-memory object will be reconstructed and will need to refresh its state from storage.

Re: Workers Durable Objects Beta: A New Approach to Stateful Serverless

#13
post #8
post #6

Earlier quoted context omitted.

Hey, I'm Greg, the PM working on Durable Objects at Cloudflare. As part of the private beta, we're looking to get feedback on the best way to price Durable Object so they're accessible for all applications - small or large. While we're in beta, storage access will be free. As we're thinking about it now, once we're out of beta this wouldn't be included in the base $5/mo plan. Since there's both a compute component (a…

"you can expect that costs for storage will be cheaper than existing services like AWS DynamoDB or Google Cloud Firestore" That's a great lead for pricing.

excellent response also.

Re: Workers Durable Objects Beta: A New Approach to Stateful Serverless

#14

Is there only a single instance of the example Counter object globally and as there are no additional await'ed calls between the get and put operations, the atomicity is guaranteed? Is the object then prevented from getting instantiated on any other worker? Can this result in a deadlock if I access DurableClass(1), then delayed DurableClass(2) in one worker and DurableClass(2) and delayed DurableClass(1) in another w…

Each object is essentially an Actor in the Actor Model sense. It can send messages (fetches, and responses to fetches) to other objects and regular workers. Incoming requests are not blocked while waiting for previous events to complete.

Hence, a block is only atomic if it contains no "await" statements.

In the counter example, the only thing we "await" (after initialization) is the storage put()s. Technically, then, you could imagine that the put()s could be carried out in the wrong order. But, we're able to guarantee that even though put() is an async method, the actual writes will happen in the order in which put()s were called.

(For those with a background in capability-based security: Our system is based on Cap'n Proto RPC which implements something called E-order, which makes a lot of this possible.)

* Disclaimer: At this very moment, there are some known bugs where put()s could theoretically happen out-of-order, but we'll be fixing that during the beta.

Re: Workers Durable Objects Beta: A New Approach to Stateful Serverless

#15

Is there only a single instance of the example Counter object globally and as there are no additional await'ed calls between the get and put operations, the atomicity is guaranteed? Is the object then prevented from getting instantiated on any other worker? Can this result in a deadlock if I access DurableClass(1), then delayed DurableClass(2) in one worker and DurableClass(2) and delayed DurableClass(1) in another w…

[deleted]

Re: Workers Durable Objects Beta: A New Approach to Stateful Serverless

#17

Really interesting, seems like it has some unique abilities. Signed up for beta invite -- does anyone happen to know whether all interested parties are admitted?

Thanks for the interest!

We're keeping access limited at first so we can get experience operating the system. We'll be expanding continually over the next few weeks.

Re: Workers Durable Objects Beta: A New Approach to Stateful Serverless

#18
> I'm going to be honest: naming this product was hard, because it's not quite like any other cloud technology that is widely-used today.

Perhaps I'm missing something important, but isn't this quite similar to Orleans grains and other distributed actors?

Re: Workers Durable Objects Beta: A New Approach to Stateful Serverless

#19
post #17

Really interesting, seems like it has some unique abilities. Signed up for beta invite -- does anyone happen to know whether all interested parties are admitted?

Thanks for the interest! We're keeping access limited at first so we can get experience operating the system. We'll be expanding continually over the next few weeks.

That's super reasonable, appreciate the reply and hopefully will get a chance to experiment with it soon =D

Re: Workers Durable Objects Beta: A New Approach to Stateful Serverless

#20
Interesting, i didn't see how security works? Is there backpressure on message senders? Any ordering guarantees? Are messages queued so activated objects can reconstruct state? Can passivation warmth be controlled? Can objects support multiple threads? Can objects move? Failover?
Post reply on HN