Think of DOs by analogy to a serverless function. A better (and much funnier) name might have been "serverless objects".
A "serverless function" is a stateless javascript program you upload to, say, Vercel. The external interface is a function. It is reachable at a URL.
You send a request to the URL, Vercel instantaites your program, sends the exported function the request, gets the function result, send the result to you as an HTTP response, then destroys the program.
DOs are exact same thing, but stateful. You upload a JavaScript program to CloudFlare. The external interface is a *class*, not a function. DOs are reachable at a URL. You send a request to the URL and CloudFlare invokes your program, instantiates your class, and sends a particular method on the class the request, gets the result, and send it to you as an HTTP response.
So far, just a more complicated version of serverless functions.
The difference is that CF keeps that class running for awhile. If another request comes into same URL, CF routes it to the same running program and the same exact JavaScript object in memory.
So you can keep state in that JS objects across invocations.
That's it, that's the whole pitch.
These little javascript programs are low-power (last I looked max ram was maybe 1GB?). But they are cheap to run so you can have zillions of them. This makes them a very useful primitive for certain kinds of problems, like say chatrooms, multiplayer games, etc.
@samgoodwin89@dillon_mulroy You can’t initiate a worker from a DO without also being billed for wall time for that particular DO. For workflows, you’ll need some task coordination, right?
As I understand it is the tradeoff b/w being billed for wall time vs cpu when managing workflows yourself vs through cf
@samgoodwin89@dillon_mulroy Workflows have one part where Cloudflare only charges you for wall time even though the workflow is running through Durable Objects. Which is where the advantage lies. I highly doubt that gets open sourced or exposed through the API.
@mitsuhiko I dunno, I find it pretty convenient for what directories I need to scan for any config without guessing what new convention someone might have ended up with. Granted I’ve mostly been on macOS for the past few years.
@gabrielnocode@samlambert@dok2001 OLAP and OLTP works are very different in nature. Planetscale only does OLTP. Wouldn’t make sense to use Postgres or Vitess for those workloads.
@cramforce It is the other way around. POSIX being the primitive is because of its history. If there wasn’t enough of it in the training data, it likely would not be anyone’s choice as the primitive.
@khepin@schniz@1Password It might still be doing an access check, unless you can def access the secret without an internet connection, then I am in the wrong
@NathanFlurry@rivet_dev paired with tiered storage it makes rivets the better way to interop even if I have Cloudflare in my existing stack
I just need time to explore it fully ;-;