Skip to content

Primatomic

Event logs. WASM views. Deterministic state.

AppendProcessQuery

Write events to immutable logs. WASM views consume events and build state. Query that state with consistency guarantees.

┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Append │ ──▶ │ View │ ──▶ │ Query │
│ Events │ │ (WASM) │ │ State │
└─────────────┘ └─────────────┘ └─────────────┘

Append-only event logs. Events are binary payloads-JSON, Protobuf, whatever you need. Once written, they’re immutable and ordered.

Terminal window
curl -X POST https://api.primatomic.com/logs/$LOG_ID/append \
-H "Authorization: Bearer $TOKEN" \
-d '{"item": "widget", "qty": 5}'

Deploy WebAssembly components that process your logs. A view receives each event in order and maintains state-counters, aggregates, indexes, projections.

Views implement a simple interface:

  • init() - set up initial state
  • append(event) - process one event
  • query(input) → output - answer questions about state
  • snapshot() → bytes - serialize for persistence
  • restore(snapshot) - recover from a snapshot

Query with sequence numbers to guarantee read-after-write consistency. After appending event #42, query with ?after=42 to ensure your view has processed it.

Terminal window
# Append returns the sequence number
seq=$(curl -X POST .../append -d '...' | jq .sequence)
# Query waits for that sequence
curl ".../query?after=$seq" -d '{"type": "get_total"}'