Outbox Pattern とは?
outbox pattern は、ビジネスデータを変更するのと同じローカルトランザクション内で、送信すべきイベントを outbox テーブルに保存します。別の relay プロセスがその outbox を読み取り、イベントを message broker へ publish して送信済みとしてマークします。これにより、データ変更が commit された場合に限り、そのイベントが記録されることが保証されます。
なぜ重要か
データベースと broker への書き込みを別々の二つのステップで行うと、一方が成功して他方が失敗し、イベントを喪失または重複させる恐れがあります。outbox はイベントとデータ変更を atomic にし、その後に確実に publish します。
関連ガイド
What Is Saga Orchestration?Saga orchestration coordinates a long-running, multi-service transaction as a sequence of local steps with co…
What Is a Change Data Capture Stream?A change data capture stream emits a continuous feed of row-level inserts, updates, and deletes from a databa…
What Is Idempotency Key Handling?Idempotency key handling uses a client-supplied unique token to ensure a retried request is processed at most…