TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Workers Durable Objects Beta: A New Approach to Stateful Serverless

209 pointsby ispiveyover 4 years ago

22 comments

_ahs0over 4 years ago
Demo chat application from the article using Durable Objects:<p>- <a href="https:&#x2F;&#x2F;edge-chat-demo.cloudflareworkers.com" rel="nofollow">https:&#x2F;&#x2F;edge-chat-demo.cloudflareworkers.com</a><p>- A Public Room (to joint test):<p>hackernews<p>- Source: <a href="https:&#x2F;&#x2F;github.com&#x2F;cloudflare&#x2F;workers-chat-demo" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;cloudflare&#x2F;workers-chat-demo</a><p>Insanely awesome feature add (much needed for truly “serverless” application development). The power to scale here without insane infrastructure headache is amazing.<p>One day some kid is totally going to build a single-person billion dollar company from his mom’s basement.
评论 #24619060 未加载
评论 #24617567 未加载
caternover 4 years ago
Wow, very cool! I didn&#x27;t see the string &quot;mobile code&quot; in this press release, but that&#x27;s essentially what this is, right? Automatically moving objects to be near the computation that needs it, is a long-standing dream. It&#x27;s awesome to see that Cloudflare is giving it a try! Plus, the persistence is clever - I&#x27;m guessing that makes the semantics of mobility much easier to deal with.<p>I love the migration to nearby edge nodes, but here&#x27;s a question to any Cloudflare employees around: Have you given any thought to automatically migrating Durable Objects to end user devices?<p>That has security implications of course, so if you&#x27;ve dismissed the idea previously because the security issues are too hard to surface to the developer, that&#x27;s reasonable.
评论 #24619148 未加载
评论 #24619714 未加载
jacques_chesterover 4 years ago
&gt; <i>I&#x27;m going to be honest: naming this product was hard, because it&#x27;s not quite like any other cloud technology that is widely-used today.</i><p>On a superficial skim it looks like a tuple space; they were heavily researched in the 80s and 90s. JavaSpaces emerged in the late 90s but never took off.<p>Scala folks are keen on Actor models (Lightbend have been using the term &quot;Stateful Serverless&quot; for a while now), as are Erlang and Elixir folks.<p>I guess the key here is &quot;widely-used&quot;.<p>Edit: this sounds even more arrogant than I intended. Sorry. I just feel bad for tuple space researchers (including my Honours supervisor). They laboured mightily in the 80s and 90s and their reward was to be largely ignored by industry.
评论 #24619097 未加载
评论 #24618903 未加载
jopsenover 4 years ago
What is the size limits for a durable object?<p>The read&#x2F;write limit per second?<p>That usually the first things I want to know about my cloud primitives...<p>(Credits for at-least being clear about consistency which is always my very first question)
评论 #24622140 未加载
toddhover 4 years ago
Interesting, i didn&#x27;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?
评论 #24617903 未加载
ramchipover 4 years ago
&gt; I&#x27;m going to be honest: naming this product was hard, because it&#x27;s not quite like any other cloud technology that is widely-used today.<p>Perhaps I&#x27;m missing something important, but isn&#x27;t this quite similar to Orleans grains and other distributed actors?
评论 #24617551 未加载
cxrover 4 years ago
Some wanky theory about computing and the design of programs follows. (Not out of scope considering the philosophical underpinnings of this product and the &quot;edge&quot;, etc.)<p>The chat demo says:<p>&gt; With the introduction of modules, we&#x27;re experimenting with allowing text&#x2F;data blobs to be uploaded and exposed as synthetic modules. We uploaded `chat.html` as a module of type `application&#x2F;octet-stream`, i.e. just a byte blob. So when we import it as `HTML` here, we get the HTML content as an `ArrayBuffer`[...]<p><pre><code> import HTML from &quot;chat.html&quot;; </code></pre> I&#x27;ve thought a lot about this for the work that I&#x27;ve been doing. From an ergonomics standpoint, it&#x27;s really attractive, and the only other viable alternatives are (a) dynamically reading the asset, or (b) settling on using some wrapper pattern so the original asset can be represented in the host language, e.g.:<p><pre><code> export const IMAGE_DATA = &quot;iVBORw0KGgoAAAANSUhEUgAAAD8AAAA&#x2F;...&quot; + &quot;...&quot; export const HTML = ` &lt;!-- totally the HTML I wanted to use --&gt; `; </code></pre> ... which is <i>much</i> less attractive than the &quot;import&quot; way.<p>Ultimately I ended up going with something closer to the latter, and there wasn&#x27;t even any reluctance about it on my part by the time I made the decision—I was pretty enthusiastic after having an insight verging on a minor epiphany.<p>I&#x27;d been conflicted around the same time also about representing &quot;aliens&quot; (cf Bracha) from other languages and integrating with them. I slapped my head after realizing that the entire reason for my uneasiness about the latter &quot;data islands&quot; approach was because I wasn&#x27;t truly embracing objects and that these two problems (foreign integration and foreign representation) were very closely related. Usually you <i>don&#x27;t</i> actually want `HTML`, for example, and focusing on it is missing the forest for the trees. I.e., forget whatever you were planning with your intention to leave it to the caller&#x2F;importer to define procedures for operating on this inert data. Make it a class that can be instantiated as an object that knows things about itself (e.g. the mimetype) and that you can send messages to, because that&#x27;s what your program <i>really</i> wants it to be, anyway. Once you&#x27;re at that point, the &quot;wrapper&quot; approach is much more palatable, because it&#x27;s really not even a wrapper anymore.
pier25over 4 years ago
If I&#x27;m getting this right, it&#x27;s essentially immediately consistent distributed state for workers. They could have called it simply &quot;Workers State&quot; :)<p>Now in all seriousness, this is super impressive. Congrats to the CF team!
评论 #24618459 未加载
agottererover 4 years ago
Is it possible to query across objects? Like if you wanted to find every object instance which had “string” written to it?<p>Can the data store only store alphanumeric or can you write blobs? Could a chat app store uploads inside the object?
luordover 4 years ago
Now this is one of the times I wish I had at least one idea for an application, because this is the kind of thing I&#x27;d like to try out.<p>Oh, well, I&#x27;ll wait until it&#x27;s an open beta or generally available.
phnover 4 years ago
I cannot find any word on pricing, is it included in the regular workers $5&#x2F;mo plan?
评论 #24616775 未加载
评论 #24616639 未加载
评论 #24616825 未加载
visargaover 4 years ago
How would you debug and upgrade your durable objects?
评论 #24617011 未加载
asdevover 4 years ago
are updates to durable objects guaranteed to be exactly once?if an update is sent but the connection between client and object are dropped, how is that handled?
评论 #24619003 未加载
vyrotekover 4 years ago
Is this similar to Azure Durable Functions?<p><a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;azure&#x2F;azure-functions&#x2F;durable&#x2F;durable-functions-overview" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;azure&#x2F;azure-functions&#x2F;durab...</a><p>From what I understand these features are a nice way to implement a serverless Actor Model. I was surprised to see no reference to it on the CloudFlare page.
评论 #24618714 未加载
评论 #24617940 未加载
dividuumover 4 years ago
Is there only a single instance of the example Counter object globally and as there are no additional await&#x27;ed calls between the get and put operations, the atomicity is guaranteed? Is the object then prevented from getting instantiated on any other worker?<p>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?
评论 #24617172 未加载
评论 #24625365 未加载
评论 #24617198 未加载
ilakshover 4 years ago
All hail the Cloudflare Gods! They are benevolent gods, say I!<p>And today they have given into us a new, powerful bounty of storage with a delicious API!
kovekover 4 years ago
This is awesome, and I&#x27;m so excited to read through the chat.mjs code. I might consider trying this out for a project. It means I need to use cloudflare? I wonder if in the future, this could become more standard, and one could do something similar on their own infrastructure (maybe such a solution already exists, open sourced somewhere?)
skybrianover 4 years ago
I’m wondering what sort of durability guarantees there are in case of an outage? It seems like replicating durable storage would add latency?<p>Is there going to be Jepsen testing for this?
评论 #24618255 未加载
gavinrayover 4 years ago
Really interesting, seems like it has some unique abilities.<p>Signed up for beta invite -- does anyone happen to know whether all interested parties are admitted?
评论 #24617377 未加载
akritrimeover 4 years ago
One thing I am not sure, maybe I missed something in the blog but will there be always one instance of this object or can there be multiple?
评论 #24618070 未加载
proppyover 4 years ago
what&#x27;s the maximum qps that a single durable object can handle?
评论 #24623033 未加载
asimover 4 years ago
Is this not sharding?
评论 #24625389 未加载