Idempotency
冪等性
冪等性とは、同じ意図した操作を再度行っても、サーバーに対する効果が一度行った場合と同じであることを意味します。返信が完全に同一である必要はありません。
もう一つの例
支払いがタイムアウトした後、バイヤーは冪等性キー `8f2…` と同じ正規化リクエストハッシュで再試行します。サーバーは再請求するのではなく最初の請求を返します。同じキーで異なる金額の場合は拒否され、キーは書面によるポリシーに基づいて期限切れになります。
主な部分
- 01操作識別
- 02重複検出
- 03安定した効果と保存された結果
以下の場合に使用します
信頼性の低いネットワーク、キュー、支払い呼び出し、メッセージが少なくとも一度は配信される可能性のあるシステムに対して、再試行を安全に行えるようにしてください。
以下の場合は使用しないでください
`POST` は常に非冪等ではありません。冪等性キーもトランザクション、認可、または競合チェックの代わりにはなりません。
コードで使用する名前
HTTP method semantics and/or scoped idempotency key with request fingerprint 出荷前に
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 冪等性 (Idempotency)。 User context:支払いがタイムアウトした後、バイヤーは冪等性キー `8f2…` と同じ正規化リクエストハッシュで再試行します。サーバーは再請求するのではなく最初の請求を返します。同じキーで異なる金額の場合は拒否され、キーは書面によるポリシーに基づいて期限切れになります。 Technical concept or control:冪等性 (Idempotency)。 Why it fits:信頼性の低いネットワーク、キュー、支払い呼び出し、メッセージが少なくとも一度は配信される可能性のあるシステムに対して、再試行を安全に行えるようにしてください。 Do not use it when:`POST` は常に非冪等ではありません。冪等性キーもトランザクション、認可、または競合チェックの代わりにはなりません。 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):この標準は、列挙された範囲のみを対象とします。視覚スタイル、製品の判断、またはVibularyの例は選びません。 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 冪等性 (Idempotency) is used now. Definition: 冪等性とは、同じ意図した操作を再度行っても、サーバーに対する効果が一度行った場合と同じであることを意味します。返信が完全に同一である必要はありません。 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.