Why this matters
- VaultCommerce order INSERT and outbox INSERT commit atomically in Postgres.
- Relay polls outbox with
FOR UPDATE SKIP LOCKED— horizontal scale without duplicate publish. - At-least-once relay means consumers still need idempotency.
- Industry standard before reaching for Kafka transactions alone.
@TransactionalOrder + outbox row
Outbox relay
Kafka topic
Outbox table design
Columns: id, aggregate_type, aggregate_id, event_type, payload (JSON/Avro bytes), created_at, published_at. Index on (published_at) WHERE published_at IS NULL. VaultCommerce relay batches 100 rows per tick.
Key points
- Outbox table — staging events in OLTP alongside business rows
- Relay — process that reads outbox and publishes to Kafka
- Same transaction — business write + outbox insert atomic
- SKIP LOCKED — concurrent relay workers without row contention
- Debezium outbox event router — CDC-based relay from outbox table
The rest of this guide is part of Pro
Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.
Still to come · 2 sections
- Relay implementation
- VaultCommerce rollout checklist
Test yourself
Answer these before moving on — recall is what makes it stick.