Why Fireweed

Fireweed is the data plane for Snorri and Cayce. It holds the durable workflow data that is high in volume or rate of change: work items, workflow state, per-recipient state, admission chunk state, operational events and timelines. Each kind gets a declared shape and a real table, so a consumer doesn't keep it in process memory or rewrite one large JSON document on every change.

NeedIn Fireweed
Work that becomes due, is leased and finishes A queue. claim leases due items in (due_at, priority, id) order; settle ends a lease as complete, fail, retry or release.
Keyed state that must not go backwards A table with merge rules: add_only sets and non_decreasing numbers and times.
History in commit order A sequenced table: ids are gapless and in commit order, and rows are never updated.
A change across several objects One program. Its statements run in order in one transaction; a rejection rolls all of them back.
Compare-and-set and guards update with expect, and assert, which counts rows and writes nothing.
Retrying a write whose outcome is unknown A request id. A replay returns the recorded response; the same id with a different program fails with request_id_conflict.
Counts and lists for a UI select with aggregate over an index, and declared reads.

A space is the unit of atomic change

A space is one atomic domain owned by one tenant, never wider than one workflow or one campaign. A program runs in one space. Snorri uses one space per workflow, holding all its runs; a run is an indexed run field on its items and rows.

Outside Fireweed

  • The control plane: tenants, campaign definitions and configuration, in its own PostgreSQL.
  • Exhaust: logs, traces, full history and analytics across data sets go to Niflheim.
  • State a tenant shares across all its spaces, such as send caps and rate windows.
  • Large payloads: a field holds a reference.
  • SQL from consumers, and joins. A lookup inside a where tests existence only.

The decisions behind this boundary are in ADR-027.