---
title: "Dex vs. Temporal"
description: "How Dex and Temporal differ in Worker memory and CPU, server throughput, operations, long-running processes, features, and code, with measured numbers, the two architectures, what they share, and a terms map."
canonical_url: "https://docs.superdurable.io/intro/compared-to-temporal/"
source: "docs/content/intro/compared-to-temporal.mdx"
locale: "en"
---

> Index of every page for AI agents: https://docs.superdurable.io/llms.txt

# Dex vs. Temporal

Dex and Temporal both run processes that survive crashes, restarts, and long waits. Temporal replays workflow code against an Event History kept in a database, while Dex saves each Step's result and runs as one binary on object storage.

[Watch on YouTube](https://youtube.com/shorts/b0IyH3H5DpE): Why Dex is lighter than Temporal

<a id="differences-at-a-glance"></a>

## Differences at a glance

Measured numbers come from the [dex-vs-temporal-demo](https://github.com/superdurable/dex-vs-temporal-demo) repository and the Dex [Performance](https://docs.superdurable.io/intro/performance.md) page.

| Topic                                                                                                                    | Temporal                                                                                                                                                                                                                                                                                                                                                                                                                                              | Dex                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Worker memory and CPU](https://docs.superdurable.io/intro/compared-to-temporal/performance.md#worker)                   | In a 512 MB container, the Worker was [OOM-killed](https://github.com/superdurable/dex-vs-temporal-demo/tree/f5aa9f90a5c4a51ae86387e13a5d0d48bb31bb3a/bench/results/temporal-default-cache-512m), and 715 messages got no reply. With 2 GB and a cache of 50 Workflows, it peaked at [581.6 MiB and 36.3% CPU](https://github.com/superdurable/dex-vs-temporal-demo/tree/f5aa9f90a5c4a51ae86387e13a5d0d48bb31bb3a/bench/results/temporal-cache50-2g). | In 512 MB, the Worker peaked at [85.5 MiB](https://github.com/superdurable/dex-vs-temporal-demo/tree/f5aa9f90a5c4a51ae86387e13a5d0d48bb31bb3a/bench/results/dex-512m) and answered all 3,000 messages. With 2 GB, it peaked at [79.8 MiB and 17.4% CPU](https://github.com/superdurable/dex-vs-temporal-demo/tree/f5aa9f90a5c4a51ae86387e13a5d0d48bb31bb3a/bench/results/dex-2g). |
| [Server throughput](https://docs.superdurable.io/intro/compared-to-temporal/performance.md#server)                       | Temporal Cloud's default limit is [500 actions per second per Namespace](https://docs.temporal.io/cloud/limits).                                                                                                                                                                                                                                                                                                                                      | One Dex Server node on S3 ran [1,772 SYNC Steps per second on 2 vCPU and 8,403 on 16 vCPU](https://docs.superdurable.io/intro/performance.md). The 16 vCPU node answered 67.3k Attribute-read RPCs per second.                                                                                                                                                                    |
| [Running the server](https://docs.superdurable.io/intro/compared-to-temporal/operations.md#run-the-server)               | [Frontend, History, Matching, and Worker services](https://docs.temporal.io/temporal-service/temporal-server) on Cassandra, MySQL, or PostgreSQL, plus a Visibility store.                                                                                                                                                                                                                                                                            | One binary. Its only required dependency is object storage: Amazon S3, Google Cloud Storage, Azure Blob Storage, Aliyun OSS, Tencent COS, or an S3-compatible store such as MinIO. db9 can take its place.                                                                                                                                                                        |
| [Long-running processes](https://docs.superdurable.io/intro/compared-to-temporal/operations.md#history-limit)            | An Event History holds at most [51,200 events or 50 MB](https://docs.temporal.io/workflow-execution/limits). A longer process needs Continue-As-New in your code.                                                                                                                                                                                                                                                                                     | Dex keeps each run's newest events and prunes older ones. The run keeps going without a new run.                                                                                                                                                                                                                                                                                  |
| [Data size](https://docs.superdurable.io/intro/compared-to-temporal/operations.md#data-size)                             | A payload holds at most [2 MB](https://docs.temporal.io/troubleshooting/blob-size-limit-error). A self-hosted server warns at 512 KB.                                                                                                                                                                                                                                                                                                                 | A value holds up to 16 MiB, and a Flow run up to 64 MiB of active state, by [default](https://docs.superdurable.io/reference/server/configuration.md#limits).                                                                                                                                                                                                                     |
| [Going back to an earlier point](https://docs.superdurable.io/intro/compared-to-temporal/shared-features.md#time-travel) | [Reset](https://docs.temporal.io/cli/workflow) terminates the current run and starts a new run with a new Run ID.                                                                                                                                                                                                                                                                                                                                     | Time Travel moves the same run back to an earlier point. The Run ID stays the same, and the run gets a new run attempt.                                                                                                                                                                                                                                                           |
| [Features only in Dex](https://docs.superdurable.io/intro/compared-to-temporal/features.md)                              | The page gives the workaround in Temporal for each feature.                                                                                                                                                                                                                                                                                                                                                                                           | Flow designs drawn from source, forms generated in Dex Web, Clone fork, Connectors, `SkipTimer`, waits for a Step or an Attribute, and reads without a Worker.                                                                                                                                                                                                                    |
| [Changing code](https://docs.superdurable.io/intro/compared-to-temporal/programming-model.md#change-code)                | A deploy that changes the commands of an open run fails its Workflow Task with a nondeterminism error. [Patching](https://docs.temporal.io/develop/python/workflows/versioning#patching) or [Worker Versioning](https://docs.temporal.io/worker-versioning) keeps open runs working.                                                                                                                                                                  | Each Step runs the code of the Worker that takes it. The demo's change needed no versioning code.                                                                                                                                                                                                                                                                                 |
| [Writing code](https://docs.superdurable.io/intro/compared-to-temporal/programming-model.md#more-code)                   | Workflow code must be [deterministic](https://docs.superdurable.io/intro/compared-to-temporal.md#the-main-difference-an-explicit-step-graph-not-replayed-code). The demo's reply-with-approval Workflow has 26 lines.                                                                                                                                                                                                                                 | Steps are ordinary code. The same Flow has 26 lines.                                                                                                                                                                                                                                                                                                                              |

<a id="architecture"></a>

## Architecture

The Temporal Worker [caches Workflow state in memory](https://docs.temporal.io/sticky-execution). The Dex Worker reads large values through a [blob cache](https://docs.superdurable.io/components/application.md#blob-cache) on disk.

> **Diagram**: Temporal: your Worker keeps an in-memory cache of Workflow state and talks to the Temporal Service, which runs Frontend, History, Matching, and Worker services on a database (Cassandra, MySQL, or PostgreSQL). Dex: your Worker keeps a blob cache on disk and talks to one Dex Server binary, which keeps current state in a local disk store and writes to object storage.

<a id="the-main-difference-an-explicit-step-graph-not-replayed-code"></a>

## Replay and saved Step results

The two engines continue a run in different ways after a Worker stops.

> **Diagram**: A Worker stops mid-run. Temporal: the Event History holds every command and result; a new Worker replays the workflow function from the top to the last await, so workflow code must be deterministic, and a retried Activity must be idempotent. Dex: Step results and Attributes are saved with each decision; a Worker continues from that saved progress with the next Step, and work that was in progress may be retried under its retry policy, so each Step must be idempotent.

**Temporal.** A Workflow is one function. The server records an Event History, "a complete and durable log of everything that has happened in the lifecycle of a Workflow Execution". When the run is not in a Worker's cache, a Worker runs the function again from the beginning. Recorded Activity results are returned instead of running the Activities again. The commands the code produces are checked against the history, and a mismatch is a nondeterminism error. Clock reads, random numbers, and I/O go through Temporal APIs or into Activities. An Activity can run more than once: "Temporal recommends that Activities be idempotent" ([Activity Definition](https://docs.temporal.io/activity-definition#idempotency)).

**Dex.** A Flow is a set of Steps. Each Step returns a decision that names the next Steps or completes the Flow. Dex saves each finished Step's result, its Attribute writes, and the decision together. A Worker continues from that saved state with the next Step. Work that was in progress may be retried under its retry policy, so each Step must be idempotent. [Failover and Deploys](https://docs.superdurable.io/concepts/failover-and-deploys.md) lists what runs again in each case.

<a id="what-they-share"></a>

## What they share

- A server records each run's progress outside your process. After a crash, the run continues from that record.
- Workers in your own process pull tasks from the server. Your code never runs inside the server.
- Timers are durable. A run that waits on a Timer or a message holds no Worker.
- Temporal Activities and Dex Step methods have a retry policy and timeouts. Their default backoff is the same: 1 second, doubling up to 100 seconds, with no attempt limit. Dex also stops retrying a Step after 4 hours by default; see [Limits](https://docs.superdurable.io/intro/limits.md). A Temporal Workflow Task retries on its own schedule, and a Temporal Workflow Execution has no retry policy by default.
- A run has a business ID. At most one run with that ID is open at a time.
- A unit of work can run more than once. Code that calls another system passes an idempotency key.

<a id="term-map"></a>

## Terms map

| Temporal                                                                                          | Dex                                                                                                             | Notes                                                                                                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Workflow, Workflow ID, Run ID                                                                     | [Flow](https://docs.superdurable.io/concepts/flow.md), Flow ID, Run ID                                          | Same roles.                                                                                                                                                                                                                                              |
| Workflow code between Activities                                                                  | Step decisions: `GoTo`, `GoToMany`, `GracefulComplete`, `DeadEnd`                                               | Control flow is data that Dex saves with each Step.                                                                                                                                                                                                      |
| Activity                                                                                          | The `Execute` method of a [Step](https://docs.superdurable.io/concepts/step.md)                                 | One retry unit. Give each durable call its own Step.                                                                                                                                                                                                     |
| Local Activity                                                                                    | Closest: an ASYNC Step                                                                                          | Both trade some durability for latency. See [SYNC and ASYNC Steps](https://docs.superdurable.io/correctness-and-expressiveness/step-guarantees.md#sync-and-async).                                                                                       |
| Timer, `sleep`                                                                                    | [Timer](https://docs.superdurable.io/concepts/primitives/timer.md) in a Step's `WaitFor`                        | Both durable.                                                                                                                                                                                                                                            |
| Signal                                                                                            | [Channel](https://docs.superdurable.io/concepts/primitives/channel.md) message                                  | Temporal accepts a Signal with no Worker online. In Dex, the FlowService request `PublishToChannel` stores a Channel message with no Worker online. See [Send a command at most once](https://docs.superdurable.io/concepts/client.md#inbound-commands). |
| Query                                                                                             | `GetAttributes`, or a read-only [RPC](https://docs.superdurable.io/concepts/primitives/rpc.md)                  | Dex Server answers `GetAttributes` itself, with no Worker online. A Query and a read-only RPC run a handler on a Worker. See [Server-side Attribute reads](https://docs.superdurable.io/intro/compared-to-temporal/features.md#read-without-worker).     |
| Update                                                                                            | [RPC](https://docs.superdurable.io/concepts/primitives/rpc.md) that writes Attributes or publishes to a Channel | Both need a Worker.                                                                                                                                                                                                                                      |
| Workflow variables                                                                                | [Attributes](https://docs.superdurable.io/concepts/primitives/attribute.md)                                     | Dex saves them. Temporal rebuilds them by replay.                                                                                                                                                                                                        |
| Child Workflow                                                                                    | [SubFlow](https://docs.superdurable.io/concepts/primitives/subflow.md)                                          |                                                                                                                                                                                                                                                          |
| Task Queue                                                                                        | Task queue                                                                                                      | A Flow names its task queue at start and keeps it. Inside a task queue, Dex routes by Flow type.                                                                                                                                                         |
| Sticky execution                                                                                  | Sticky routing                                                                                                  | Both are best effort: each first offers the task to the previous Worker for a few seconds, then to any Worker. A Temporal Worker that misses its cache replays the Event History. A Dex Worker needs no history cache.                                   |
| Search Attributes                                                                                 | Indexed Attributes                                                                                              |                                                                                                                                                                                                                                                          |
| Workflow ID Conflict Policy, for an open Workflow ID. Workflow ID Reuse Policy, for a closed one. | ID reuse policy, for open and closed Flow IDs. Start request ID.                                                | The start request ID lets Dex recognize a retried start request. See [StartFlowOptions](https://docs.superdurable.io/reference/python/start-flow-options.md).                                                                                            |
| Cancellation                                                                                      | An RPC cancels Steps by Step type. `StopFlow` stops the Flow.                                                   | In both, your Worker code stops its external work cooperatively. Dex discards anything a canceled attempt returns later. See [Cancel running Steps](https://docs.superdurable.io/reference/server/runtime-data.md#cancel-running-steps).                 |
| Reset                                                                                             | [Time Travel](https://docs.superdurable.io/components/operate-and-debug.md#time-travel)                         | See [Going back to an earlier point](https://docs.superdurable.io/intro/compared-to-temporal/shared-features.md#time-travel).                                                                                                                            |
| Continue-As-New, to keep the history small                                                        | Not needed                                                                                                      | See [The history limit](https://docs.superdurable.io/intro/compared-to-temporal/operations.md#history-limit).                                                                                                                                            |
| Patching, Worker Versioning                                                                       | Not needed                                                                                                      | See [Changing code](https://docs.superdurable.io/intro/compared-to-temporal/programming-model.md#change-code).                                                                                                                                           |
| Schedule                                                                                          | A Flow that loops on a Timer                                                                                    | See [Cron schedule](https://docs.superdurable.io/design-patterns/durable-timer/cron.md).                                                                                                                                                                 |
| Nexus                                                                                             | No direct equivalent                                                                                            | A service in another team starts a Flow or calls an RPC over the FlowService API.                                                                                                                                                                        |
| Temporal Web UI                                                                                   | [Dex Web](https://docs.superdurable.io/components/web.md)                                                       |                                                                                                                                                                                                                                                          |

Dex evolved from iWF. An iWF State corresponds to a Dex Step, and `WaitUntil` corresponds to `WaitFor`.

<a id="videos"></a>

## Videos

The videos are in English.

- [Why Dex is lighter than Temporal](https://youtube.com/shorts/b0IyH3H5DpE): the short at the top of this page.
- [Why Temporal Workers run out of memory](https://youtube.com/shorts/qjeMoeRau7M): [Performance](https://docs.superdurable.io/intro/compared-to-temporal/performance.md#worker).
- [How Dex Server works inside](https://youtube.com/shorts/xZtFv4mOS04): [Performance](https://docs.superdurable.io/intro/compared-to-temporal/performance.md#server).
- [The same process in Temporal and Dex code](https://youtube.com/shorts/_5LuwZcJhhc): [Programming Model](https://docs.superdurable.io/intro/compared-to-temporal/programming-model.md#more-code).
- [Episode 1: one idle timer, three production problems](https://youtu.be/fzl88JWt734): the full walkthrough of [Programming Model](https://docs.superdurable.io/intro/compared-to-temporal/programming-model.md).

## Next

- [Performance](https://docs.superdurable.io/intro/compared-to-temporal/performance.md)
- [Operations](https://docs.superdurable.io/intro/compared-to-temporal/operations.md)
- [Features Only in Dex](https://docs.superdurable.io/intro/compared-to-temporal/features.md)
- [Features Both Have](https://docs.superdurable.io/intro/compared-to-temporal/shared-features.md)
- [Programming Model](https://docs.superdurable.io/intro/compared-to-temporal/programming-model.md)
