29 comments

[ 192 ms ] story [ 1452 ms ] thread
Checkpointing the live continuation shifts recovery cost toward retained state rather than lifetime event count, which seems especially useful for agents with many completed tool calls.
Kind of reminds me of how redis forks itself to have a snapshot to persist as a backup.
I always found that to be really elegant.
dropping history replay would remove so much operational pain from durable workflows. how do you reconstruct in-flight state after a crash, snapshotting or something event sourced
Lamport & Chandy, right?
Related, yes, although the current prototype is narrower. Chandy-Lamport captures a consistent global state across communicating processes whereas TCC checkpoints program continuations at compiler-defined durable boundaries.
Durable execution looks a bit like a buzzword in general. If your state is defined in the execution graph then it's just an umbrella name for a group of pre-existing algorithms and patterns (e.g. exactly-once transactions in bookkeeping are centuries old). If your state is undefined then what are you resuming to? The snapshot just before the crash likely leads to the undefined state again, in which case you're durably automating the crash (or even worse, uncaught incorrect behavior).
> Durable execution looks a bit like a buzzword in general. If your state is defined in the execution graph then it's just an umbrella term for a group of pre-existing algorithms and patterns.

If you first approach a tool because of buzzwords,don't be surprised that you think of the buzzwords instead of the tool.

Durable executions greatly simplify how workflows can be implemented and audited,and they literally allow eternal workflow executions that are not tied to the lifetime of an instance assigned to execute them.

If you understand continuations, you understand durable executions. Otherwise, you'll be stuck with the excuse that they are buzzwords.

Well, you have to either capture/eliminate/persist side effects and control the environment tightly, or it's limited in what it can do.

In a distributed or concurrent system, for full granularity, that can require specialized timing or virtualization techniques up to ensuring fully atomic snapshots and deterministic execution environments (and whether or not that properly models the SUT in real environments, or introduces bias/breaks the reproducibility in a way you care about)

Otherwise if you're only running against fixed checkpoints you have something closer to traces that maybe you could re-run or test against, in some cases, if you put in the work to set it up. In distributed systems that can be a lot of work so it's a bit vague if left unspecified. Because it's not enough to merely replay something if things can drift or don't accurately model the real system

> Well, you have to either capture/eliminate/persist side effects and control the environment tightly, or it's limited in what it can do.

You really need to read up on durable executions before commenting. Your comment reads as if you are completely oblivious to them. Their whole point is benefiting from an execution model where your workflow is comprised of idempotent pure functions whose inputs and outputs are tracked by the durable task persistence.

It's a problem I've spent a lot of time on, just not through the products marketed like temporal. I commented on the article because it's about program replay with checkpointing which is similar to what I worked with/mentioned.

I didn't see the article mention idempotency anywhere, and you didn't in the original response to the guy who said it just sounded like a buzzword; atomic snapshotting with deterministic execution is literally how you make a program continuation an idempotent function!

And the article is about solving the problem at the language runtime level so it doesn't even do that. So it would be reasonable to assume it is a buzzword if it does not have the essential property you mentioned and I was referring to. I was not even intending to disagree with you but just add what would make it less of a buzzword in this kind of case.

Snapshotting programs is also what https://github.com/pydantic/monty enables and aims for.

FWIW, I think we'll see a rise of AI-ready interpreters. In some sense, I like that it challenges traditional microservice architectures as an aside.

Nice.

Our architecture has had somewhat of a different primitive for years that yields the same outcome.

Our application architecture is named The Feature Architecture.

A unit of work is feature. A lot of common implementation can be derived from (or compressed into) the name of a feature. They are invoked by Features.invoke(feature_name,...) and seamlessly calls same service, service to service or frontend to backend service or even backend to frontend (with client ID and userid) seamlessly.

A command feature by default does durable execution by being a consumer as well as a feature as the machinery ensures all incoming command feature messages are injected into monolog (in house built akin to kafka). So command feature errors are retried by the machinery by default.

All Dip operations are idempotent and hence can be retried maximally.

Our arcc (The architecture compiler) enforces at compile time that 1) there are zero CQRS violations of query to command invocations 2) zero violations of query to Dip.insert/update/remove (extended CQRS for persistence) 3) all Dip mutate operations are idempotent (arcc --strict), 4) zero alien Dip collection access (a feature leaf and its handlers owns exactly one collection) 5) and a whole myriad of around 10 different architecture rules that usually depend on developer discipline and conventions.

One can set a command operation to be not a durable execution by specifying bypass: true for that feature in the registry but those are the outliers.

So durable executions are inherently native and first class for all commands in our Feature Architecture.

I’ve been building a durable execution framework with roughly the same mechanism. It’s a pretty logical rough edge to try shave off from Temporal-like systems.
Congratulations.

I am curious about what prompted you to build a durable execution framework.

We didn't know we were building one until later as that is where our application development trajectory naturally lead us.

How did you know you need one?
Good question.

Building for extreme scale constrained the possible architectural space. For a high level overview of the application architecture, refer to the seperate comment here in this thread.

It started initially by realizing that our app, Slyp, requires extremely distributed invoice and coupon processing as we started rolling out. So the architecture must handle such scale without issues.

This lead to persisting every incoming request from the frontend and dismissing them only to be informed later of continuing with the status. This avoids processing requests when the system is overloaded with high traffic. So naturally the minimum is a log style ordered persistence. Initially kafka. Later our own Monolog built in rust which is substantially faster for our workloads and zero jvm and low memory and can run on servers and mobile alike.

Naturally the right point to consume this was into the command ingestion point in the Feature Architecture as noted in the other comment. This expanded the capability to all feature invocations including inter and intra service feature invocations.

This then progressively evolved into a much capable engine at which point we realized, this is a durable execution engine for command features but as a minor part of the whole Feature Architecture itself.

Good question. I operate a pretty big Temporal deployment at work (~3.45 billion actions per month), and also have the dubious distinction of being one of the only community SDK (Haskell) implementors for Temporal. So I have a pretty good sense of rough edges and my own areas of dissatisfaction, and also what I'd want out of a next generation system.

So, hello frenemies, I suppose :)

Which rough edges pushed you toward the same mechanism - history growth, replay latency, determinism/versioning, worker ops, or the programming model? Happy to compare notes.
Good model. Anybody interested in actually training models or designing agentic systems should be doing this.

My company started around working on this problem because it's the basis for how you train programming models/reliably deploy LLMs to do specific tasks. It allowed me to build a much better mental model for LLMs because I saw how weirdly fickle/inconsistent/picky they could actually be outside of a "chat" where it feels like they have a coherent persona or consistent knowledge/capability.

Initially I thought of it as a search over prompts for capability at completing specific tasks, but now I think the speed/reliability and operations (eg can I switch models without degrading perforamnce?) benefits are even bigger benefits for most users.

A little "secret" since labs are making it harder to even use their models in this way and it's important that it be more widely understood: distribution-aware replay/re-sampling is a key technique in post-training LLMs. But it's also something that allows you to automatically identify the best model for some subset of your tasks, which can save you a lot of money.

Was this written by AI? I even read the "technical paper" and still don't understand what it's supposed to do. Nowhere does it explain how this "checkpointing" and "resuming a continuation" actually works in practice.
Fun fact: The first-ever Durable Execution POC at AWS Simple Workflow used snapshots. The workflow was implemented as a fully asynchronous Java application, and a snapshot was a dump of the whole object graph using reflection. Performance was abysmal because a snapshot had to be generated after every state transition.

So we switched to replay. The biggest benefit of replay is that it lets you implement Durable Execution in any language as a library without a complex runtime. It also supports code changes while workflows are in flight (Temporal calls this patching). Making snapshots of arbitrary code state backward-compatible with code changes isn't practical.

I personally think that, in the long term, Durable Execution will use a runtime that supports both snapshotting and determinism. That way, snapshots can be taken infrequently, and replay can bring workflow code to the latest state. Similarly to a database recovering from a WAL. WASM is the most promising technology to achieve this.