Athena

Daemon Runtime

How Athena splits HTTP/API ownership from durable worker ownership.

Athena supports separate runtime binaries without changing the configuration contract. athena_rs remains the main API and CLI process, while the athena-daemon workspace package exposes worker binaries that all load the same config.yaml, the same .env beside that config file, and the same control-plane or logging tables.

Default Behavior

  • cargo run -- starts athena_rs and boots the API server directly.
  • When daemon.enabled is false, athena_rs also starts inline legacy workers, the deferred query worker, backup workers, and the Typesense sync worker when those toggles are enabled.
  • Clone jobs can be created through the API, but clone execution never runs inside athena_rs.

Runtime Ownership Matrix

ProfileProcesses to rundaemon.enabledWorker ownershipWhen to use
Default bundled APIathena_rsfalseathena_rs owns inline legacy, deferred, backup, and Typesense workerssimplest local and single-process deployment
Split API + bundled daemonathena_rs and athena_daemontrueathena_daemon owns clone execution plus deferred, backup, Typesense, and optional legacy workersnormal production split
Hybrid clone-onlyathena_rs and athena_clone_workerusually falseathena_clone_worker owns clone execution while athena_rs keeps the other inline workersfirst split step when clone jobs need their own supervisor
Fully specialized worker-per-processathena_rs plus one dedicated binary per worker familytrueeach worker family is assigned to a dedicated binaryfine-grained supervision, scaling, or focused debugging

Important nuance: only clone execution can be split out while leaving daemon.enabled off. Backup, deferred, Typesense, and legacy workers do not currently have a per-family "external only, inline off" switch.

Binary Matrix

BinaryPackageOwnsTypical use
athena_rsroot packageHTTP API, CLI entrypoint, optional inline workersdefault runtime from the repo root
athena_daemonathena-daemonclone worker, deferred worker, backup workers, Typesense worker, optional legacy workersbundled background runtime
athena_clone_workerathena-daemonclone worker onlyseparate clone execution without moving the other families
athena_backup_workerathena-daemonbackup schedule and execution workers onlyworker-per-process or focused backup debugging
athena_deferred_query_workerathena-daemondeferred gateway queue worker onlyworker-per-process or focused deferred queue debugging
athena_typesense_workerathena-daemonTypesense sync worker onlyworker-per-process or focused search-sync debugging
athena_daemon_legacy_workersathena-daemonconnection monitor, outbox relay, registry reconnect, optional vacuum health collectorworker-per-process or migration away from inline legacy startup

Shared Bootstrap Contract

All runtime binaries still share the same operator contract:

  • ATHENA_CONFIG_PATH and the normal config search path resolve the same config.yaml
  • .env is loaded from beside the resolved config file
  • client bootstrap still uses the same registry and logging database
  • clone and backup runtimes still depend on pg_dump and pg_restore
  • worker ownership is still published into the same control-plane runtime registry

The split is process ownership and supervision, not a separate deployment configuration model.

Deployment Rules

  • Keep daemon.enabled: false when athena_rs should continue to own legacy, deferred, backup, and Typesense workers inline.
  • Set daemon.enabled: true when those daemon-owned families will be started outside the API process.
  • Use athena_clone_worker as the only supported "split one family first" topology. It is safe because clone execution is never owned by athena_rs.
  • Do not run two runtimes that can claim the same worker family.
  • Do not assume a healthy API process means clone jobs will execute; clone jobs require either athena_daemon or athena_clone_worker.

Common Commands

# Default API runtime
cargo run --

# Explicit server subcommand
cargo run -- server

# Bundled daemon runtime
cargo run -p athena-daemon --bin athena_daemon

# Dedicated runtimes
cargo run -p athena-daemon --bin athena_clone_worker
cargo run -p athena-daemon --bin athena_backup_worker
cargo run -p athena-daemon --bin athena_deferred_query_worker
cargo run -p athena-daemon --bin athena_typesense_worker
cargo run -p athena-daemon --bin athena_daemon_legacy_workers

For a full API and daemon split, set daemon.enabled: true first. For a clone-only hybrid deployment, daemon.enabled can remain false.