BotNetwork

Transactional outbox for bot sends

write outbound intents in the same DB transaction as state changes

Guide1 min readUpdated

Why it matters

Write outbound intents in the same DB transaction as state changes.

Practical steps

  1. Choose storage for data outbox pattern deliberately (SQLite vs Postgres vs KV); document why.
  2. Implement write outbound intents in the same DB transaction as state changes with migrations that are additive and reversible where possible.
  3. Use transactions / idempotency keys so retries of data outbox pattern do not double-write.
  4. Add a fixture DB and migration test covering data outbox pattern.
  5. Document backup/restore touching tables used by data outbox pattern.

Watch out for

  • Copy-pasting outdated snippets for data outbox pattern without re-reading current official docs.
  • Shipping data outbox pattern to production without a staging rehearsal and a documented rollback.

Related comparisons and tools