Docs

Clear documentation
for real-world use.

Get up and running with setup guides, API references and delivery behaviour from the current project.

View on GitHub

Architecture

PostgreSQL is the system of record. Redis holds rate-limit and circuit-breaker state; SQS carries delivery work.

The event path

  1. Your application

    POST /events with a tenant ID, type and payload.

  2. Ingestion API

    Validate the request, check the tenant and apply its ingestion budget.

  3. PostgreSQL

    Commit the event and its outbox entry in one transaction.

  4. Outbox poller

    Publish pending entries to SQS, then mark confirmed sends published.

  5. SQS

    Buffer the envelope or its S3 payload pointer.

  6. Delivery worker

    Apply delivery controls, resolve the payload and sign the HTTP POST.

  7. Destination

    The worker’s RECEIVER_URL receives the signed envelope.

One active publisher

The dedicated poller uses pg_try_advisory_lock(728401) on a single database connection. The lock elects a publisher; standby pollers wait. The API does not publish directly to SQS.

A failed send leaves the entry pending. A crash after SQS accepts the send but before the published flag is stored can cause duplicate publication.

Payloads and failure storage

S3 stores oversized payloads and dead-letter archives. Redis is not the queue. On retry, the worker changes visibility on the same SQS message. On exhaustion it archives and persists failure state before acknowledgement.

Delivery semantics

Delivery is at-least-once with bounded retries, not exactly-once. A permanently failing receiver is not guaranteed eventual delivery. Primary writes and replica reads are separate; a healthy replica may temporarily show older state.