Skip to content

Architecture

Dory runs your processors for you. The platform keeps a record of which processors should be running — one for each sensor × template pair that at least one subscription needs — and Dory continuously makes the live system match that record and keeps it that way. What each processor does and how much compute it needs come from its template. You never schedule a container, pick a machine, or babysit a crash; the platform does that on your behalf, around the clock.

This page explains how Dory is put together at a high level, so you understand the guarantees behind that promise.

Two planes: control and data

Dory separates the system that decides what should run from the system that does the running.

Plane What it is What it gives you
Control plane The orchestrator — a service that continuously compares the recorded processors against what's actually running and corrects any difference. The record is always being enforced. If something drifts, it's brought back automatically.
Data plane Your processor instances, running on compute that scales up and down on demand, publishing events to the broker for subscribers. Your processing actually happens here, on capacity that appears when needed and goes away when it isn't.

You never start or stop a processor directly. You publish templates through the portal or API and create subscriptions through the API, and the platform turns those into the record of processors the control plane enforces. The data plane is managed for you.

Zooming into the control plane, the orchestrator isn't a single black box — it's a handful of cooperating parts, each with one responsibility:

graph TD
    DS[(Desired state)] -->|read declared processors| CW[Config watcher]
    CW -->|on every poll| REC[Reconciler]
    REC --> SCH[Scheduler]
    REC --> MIG[Migrator]
    REC --> FO[Failover manager]
    SCH -->|provision capacity| AUTO[Compute autoscaler]
    MIG --> ST[State transfer]
    REC -->|create / remove processors| RT[Compute runtime]
    MON[Event monitor] -->|machine draining| DRAIN[Drain manager]
    DRAIN --> ST
    DRAIN --> RT
    HP[Health poller] -->|health checks| RT
    API[API surface] --> OBS[Metrics, health, readiness]
    API --> EDGE[Edge operations]

It starts from the desired state — the processors recorded as wanted. A config watcher reads it on every poll, changed or not, and hands it to the reconciler, the heart of the system: it compares what is recorded against what's running and drives three specialists to close any gap — the scheduler (which places processors and asks the autoscaler for more compute when needed), the migrator (which moves a processor to another machine, carrying its state through state transfer), and the failover manager (which brings processors back when the edge machine they ran on goes offline). Separately, an event monitor watches the underlying compute: when a machine is being taken away, it tells the drain manager to relocate that machine's processors — state preserved — before it disappears. A health poller keeps checking that running processors are alive, and an API surface exposes health, metrics, and edge operations.

Where the record of processors comes from

The orchestrator does not decide which processors should exist. That is the job of the platform's subscription worker, which runs in the background behind the API:

  • A processor is recorded when a subscription needs it. When a subscription is provisioned, the worker matches sensors and lens templates to the request. For each sensor × template pair it reuses a live processor that is already recorded, or records a new one. The orchestrator finds a new record on its next poll and starts the processor.
  • A record is shared. Two subscriptions — even from different organizations — that need the same pair hold the same processor, so it runs once however many subscriptions use it.
  • A record is removed when nothing holds it any more. When a deleted subscription is released, or the hourly re-check drops a pair a subscription no longer needs, the worker removes each processor that no other subscription still holds. The orchestrator then stops it on its next poll. A processor another subscription still uses keeps running.
  • Revocation stops the processor. A processor counts as wanted only while its template has an approved, active version. When an administrator revokes the version that was live, leaving the template without one, the orchestrator terminates the running processor within a poll, without waiting for the subscription side; the hourly re-check then updates the subscriptions that relied on it.

How often the orchestrator polls is part of how the platform is deployed, so there is no fixed delay between a change to the record and the processor starting or stopping.

sequenceDiagram
    participant A as Subscription A
    participant B as Subscription B
    participant W as Subscription worker
    participant R as Record of processors
    participant O as Orchestrator
    A->>W: provisioned
    W->>R: record processor (sensor × template), held by 1
    O->>R: next poll finds the new record
    O->>O: start the processor
    B->>W: provisioned, needs the same pair
    W->>R: reuse the record, held by 2
    A->>W: deleted and released
    W->>R: held by 1, record kept, processor keeps running
    B->>W: deleted and released
    W->>R: held by 0, record removed
    O->>R: next poll finds the record gone
    O->>O: stop the processor

How the control plane keeps reality in sync

The orchestrator runs a continuous loop. On every pass it does the same simple thing:

  1. Read the desired state. It looks at the recorded processors — added and removed by the subscription worker, as described above.
  2. Observe actual state. It looks at what's currently running in the cluster.
  3. Reconcile the difference. Anything recorded but not running, it starts. Anything running but no longer recorded, it removes. Anything that has failed, it replaces.

Because this loop runs on a regular interval — not just when something changes — the system is self-correcting. If an instance crashes, a machine disappears, or anything else knocks reality out of line with the record, the very next pass notices the gap and closes it. There's no separate "repair" step you have to trigger; healing is just reconciliation finding a difference.

Declarative, not imperative

Nobody tells the orchestrator "start this," "stop that," "move this here." The record describes the end state, and the orchestrator figures out the steps to get there and to stay there. This is what makes recovery automatic: the desired state never changed, so the orchestrator simply rebuilds whatever was lost.

How it reacts to change

Two kinds of change drive the loop:

  • The record of processors changes. When the subscription worker records a new processor or removes one nobody holds any more — or a template version is revoked — the orchestrator picks up the new desired state on its next poll and reconciles toward it, creating or removing instances to match.
  • The cluster changes underneath it. The orchestrator also watches the underlying infrastructure. When a machine is about to be retired (for example, when capacity is being reclaimed or rebalanced), it reacts ahead of the disruption — moving the affected processors elsewhere, preserving their state, before the machine goes away. See State Migration & Node Drain.

Either way, the response is the same shape: observe, compare to desired, reconcile.

Where your compute comes from

Processors don't run on a fixed pool of always-on machines. When the orchestrator needs to place a processor and there's no room on existing compute, it signals for more capacity to be provisioned automatically. When processors are removed or can be packed onto fewer machines, the freed-up compute is released. You pay for what you actually run, and you never manage the machines yourself.

A practical consequence: the first start of a brand-new processor can take noticeably longer if fresh compute has to be provisioned and the processor's image downloaded. Subsequent restarts on existing capacity are much faster. See Pod Lifecycle for what each stage of startup looks like.

From processor to subscribers

Once a processor is running, it does its work and publishes results as events to the event broker. Each subscription the processor serves has its delivery queue bound to that processor's events of the requested types, so applications receive them through their subscriptions — see Subscriptions & Events. The orchestrator's job is to make sure the right processors are alive and healthy to keep that event flow going; the events themselves travel through the broker, independent of the control plane.

What this means for you

  • Subscriptions decide; Dory enforces. The processors your subscriptions need are recorded as desired state, which the platform continuously upholds — and a processor no subscription needs any more is stopped.
  • Recovery is automatic. Crashes, lost machines, and other disruptions are healed by the same loop that applies changes to the record — no manual intervention.
  • Capacity is elastic. Compute scales up to fit your processors and back down when it's no longer needed.
  • Migrations are graceful. When infrastructure must change, your processors are moved with their state preserved, not abruptly killed.