Saga パターンとは?
Saga パターンは、マルチサービスの操作をローカルトランザクションの連鎖に分割し、それぞれが自分のサービスで commit し、次のステップをトリガーするイベントを発行します。後のステップが失敗すると、完了済みのステップは補償トランザクションを実行してその影響を元に戻します。分散 lock を保持せずに整合性を提供します。
なぜ重要か
Saga は、明示的な補償ロジックを設計する代償として、two-phase commit のブロッキングコストなしにマイクロサービスの調整を可能にします。サービス境界をまたぐ整合性への一般的な答えです。
関連ガイド
What Is a Distributed Transaction?A distributed transaction spans multiple databases or services and must either commit everywhere or roll back…
What Is Two-Phase Commit?Two-phase commit is a protocol that coordinates a transaction across multiple systems by first asking all to…
What Is a Domain Event?A domain event is a record that something meaningful happened in the business domain, named in past tense and…