Event-Driven Architecture
イベント駆動型アーキテクチャ
イベント駆動型アーキテクチャでは、何かが変化した後に1つのコンポーネントがファクトを公開する。他のコンポーネントは、その配信と将来のフォーマット変更に関する明確なルールのもとで後に反応する。
もう一つの例
サブスクリプション42がキャンセルされると、請求は件名、時刻、トレースID付きのバージョン付き`SubscriptionCanceled`イベントを公開します。アクセスと分析サービスは独自に反応し、両方とも重複イベントIDを削除します。分析は後でログを再生できます。次のステップが失敗した場合、フロー全体を1つのトランザクションとして扱うのではなく、補償を使用します。
主な部分
- 01イベントの事実とスキーマ
- 02ブローカーまたはイベントログ
- 03独立して反応する消費者
以下の場合に使用します
複数の独立した利用者が必要とする永続的な事実にはイベントを使用してください。スキーマ、順序、リプレイ、失敗ルールの所有者を定義してください。
以下の場合は使用しないでください
部分が一緒に動作しなければならないリクエストチェーンを隠すためにイベントを使用しないでください。漠然としたコマンドを過去形の事実に偽装しないでください。
コードで使用する名前
versioned event envelope + durable broker/log + idempotent consumers + trace context 出荷前に
Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback.
Outcome:Complete the task with イベント駆動型アーキテクチャ (Event-Driven Architecture)。 User context:サブスクリプション42がキャンセルされると、請求は件名、時刻、トレースID付きのバージョン付き`SubscriptionCanceled`イベントを公開します。アクセスと分析サービスは独自に反応し、両方とも重複イベントIDを削除します。分析は後でログを再生できます。次のステップが失敗した場合、フロー全体を1つのトランザクションとして扱うのではなく、補償を使用します。 Technical concept or control:イベント駆動型アーキテクチャ (Event-Driven Architecture)。 Why it fits:複数の独立した利用者が必要とする永続的な事実にはイベントを使用してください。スキーマ、順序、リプレイ、失敗ルールの所有者を定義してください。 Do not use it when:部分が一緒に動作しなければならないリクエストチェーンを隠すためにイベントを使用しないでください。漠然としたコマンドを過去形の事実に偽装しないでください。 Engineering requirements: Define inputs, outputs, contracts, and rules that must always hold. Set authorization and input checks. Define failures, timeouts, retries, one-time effects, data moves, and compatibility limits. Operations: Add useful signals and logs that hide sensitive data. Set capacity limits and write an operator guide. Test recovery and rollback. Acceptance criteria: Contract and failure-path tests pass. Data and authorization rules still hold during retries and partial failures. Check performance limits, monitoring, recovery, and rollback. Evidence and limits (evidence boundary):単一の公式標準が全体の用語を管理するわけではありません。その意味はチーム、プラットフォーム、またはフレームワークによって変わる可能性があります。 Unknowns to confirm: Where the code runs, data stores, traffic shape, consistency needs, and the security boundary. Also confirm the compatibility period, service goals, and rollback limits.
このリクエストを確認する
Review how イベント駆動型アーキテクチャ (Event-Driven Architecture) is used now. Definition: イベント駆動型アーキテクチャでは、何かが変化した後に1つのコンポーネントがファクトを公開する。他のコンポーネントは、その配信と将来のフォーマット変更に関する明確なルールのもとで後に反応する。 Release checks: Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.