Architecture
The processes, storage and external services behind an axonpush installation, and how self-host differs from the hosted service.
axonpush runs as one executable. A single axonpush serve process contains the API,
the background workers, the evidence archive workers, the dashboard and a child
process for authentication. PostgreSQL holds all state and all pending work. S3
holds large payloads and the evidence archive. Nothing else is required: no Redis, no
message broker, no scheduler service.
Components
| Component | Where it runs | What it does |
|---|---|---|
| API | serve, public listener | Ingest (SDK events, OTLP, Sentry DSN), dashboard and API reads, workspace authoring, audit and evidence endpoints, MCP at /mcp, /healthz, /license. |
| Dashboard | serve, public listener | The single-page app, embedded in the executable. /runtime-config.js gives it the API and auth URLs at startup. |
| Auth service | Child process on a random loopback port | Better Auth: accounts, sessions, organisations and invitations, SSO, Google sign-in, API keys, JWT issuance and MCP OAuth. Reached through /api/auth, /api-keys and /sso on the public listener. |
| Work dispatcher | serve | Runs durable work from PostgreSQL: ingest follow-up, derived data, lifecycle deadlines, webhook and export delivery, evidence archive jobs. |
| Activity worker | serve, via the dispatcher | Projects observations into workspace entities, milestones and incidents, and fires named deadlines. |
| Monitor sweep | serve | Checks cron monitors for missed and timed-out runs once a minute. |
| Licence heartbeat | serve, via the dispatcher | Activates the licence and checks in hourly. Self-host only. See Licensing. |
The auth executable is compiled with Bun and embedded in axonpush. On first start
it is extracted into the state directory and checked against its embedded SHA-256 on
every start. It only listens on 127.0.0.1, and the API reaches its internal routes
with a secret generated per installation.
If the auth child or the dispatcher stops, the whole process exits so the service manager restarts a consistent installation.
Request path
- A client calls the public listener (directly, or through your reverse proxy).
- Admission control allows at most
PORTABLE_MAX_ACTIVE_REQUESTSrequests (default 8) at a time. Extra requests get503withRetry-After: 1before their body is read./healthzis never refused. - Auth routes are proxied to the auth child. Everything else goes to the API or the dashboard files.
- For ingest, the API validates the key and scope, applies redaction and capture
policy, writes the events to PostgreSQL and queues follow-up work in the same
database, then responds. A
storedresponse means durably accepted, not yet projected. - Payloads too large to keep inline are written to the payload bucket and referenced from the event row.
Durable work and event transport
The self-host runtime uses PostgreSQL as its event transport. Work is a row in
portable_delivery; LISTEN/NOTIFY only wakes the dispatcher, it is not the source
of truth.
- Producers and consumers ship in the same executable, so batches are compressed and can be up to 1 MiB encoded.
- On startup the dispatcher scans only pending work. It then waits for notifications or the next due time, with no polling loop.
- Leases expire and are picked up again after a crash, so a job can run more than once. Handlers are written to be idempotent.
- Failed work is retried with backoff, then marked failed and kept for seven days.
axonpush jobs listandaxonpush jobs retrylet you inspect and redrive it. - A PostgreSQL advisory lock allows exactly one dispatcher per database. A second
serveagainst the same database exits.
Named deadlines (for example “no reply within 2 hours”) are rows with a due time, so they survive restarts. If the host is down when one falls due, it runs when the service is back.
PostgreSQL
One database holds everything: application tables, the auth tables, workspace revisions, the hot copy of events, pending work, licence state and evidence metadata (segments, seals, locators). There is no second database.
The runtime opens at most five connections from its main pool, two from the auth
service (AUTHSVC_DB_MAX_CONNS) and one dedicated listener connection for the
dispatcher. Migrations run with a separate owner login; the service itself uses a
role with data privileges only. See Self-host.
Object storage
| Bucket | Mutable | Contents |
|---|---|---|
Payload bucket (INGEST_ARCHIVE_BUCKET) | Yes | Large event payloads and temporary objects. |
Archive bucket (EVIDENCE_ARCHIVE_BUCKET) | No, Object Lock | Hourly sealed segments: encrypted records, metadata and a signed manifest per part. |
Key bucket (EVIDENCE_KEYS_BUCKET) | Overwrite only, never versioned | Wrapped per-subject and per-organisation keys. Overwriting a key with a tombstone is how erasure works. |
Events stay in PostgreSQL for the hot window (30 days on self-host unless the licence sets another value). With the archive enabled, each closed hour is sealed into the archive, and hot rows are deleted only after their sealed copy exists. Older events are read back from the archive on demand. The two evidence buckets are optional; see Evidence archive.
External services
| Service | Used for | Required |
|---|---|---|
| Amazon SES | Sign-up, invitation, password reset and alert emails | Yes |
axonpush control plane (control.axonpush.xyz) | Licence activation and hourly heartbeat | Yes, self-host |
| RFC 3161 timestamp authority | Independent timestamps on daily archive anchors | No |
| Your webhook, OTLP and evidence pack destinations | Outbound delivery | Only if configured |
Outbound delivery uses a client that refuses redirects, private addresses and ports
other than 80, 443 and 4318 unless you allow them with AXONPUSH_OUTBOUND_PORTS and
AXONPUSH_OUTBOUND_PRIVATE_ORIGINS.
Self-host and the hosted service
The hosted service at app.axonpush.xyz runs the same code, built as a separate edition. The edition is fixed at build time, so a self-host executable cannot be switched into the hosted edition by configuration.
| Self-host | Hosted | |
|---|---|---|
| Licence | Required; activation and hourly heartbeat | None |
| Limits | From the licence: seats, hot retention, monthly events, features | Plan catalog |
| Billing | None | Plans and top-ups |
| Organisations | Any number, subject to SIGNUP_MODE | Per-account allowance |
| Hot retention | 30 days, or the licence’s value | Depends on plan |
| Default archive | GOVERNANCE lock for 2,555 days | Depends on plan |
| Compliance features | On unless the licence turns them off | Depends on plan |
| Who runs PostgreSQL, S3, SES, backups and upgrades | You | axonpush |
| Data location | Your database and buckets, in the region you choose | axonpush’s infrastructure |
The source tree also contains separate api, worker, activity-worker and cron
programs and a CDK app for an AWS Lambda deployment. That deployment is retired and
is not supported for new installations.