{
  "id": 3407986,
  "title": "Two-Layer Idempotency: Why Not Every Settlement System Needs an Outbox",
  "url": "https://urgent.news/2026/08/26/two-layer-idempotency-why-not-every-settlement-system-needs-an-outbox",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-26T02:20:42.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/douglas_carmo_cd84c5548f2/two-layer-idempotency-why-not-every-settlement-system-needs-an-outbox-57d5"
  },
  "original_language": "en",
  "account": "In a recent discussion about settlement APIs, a key concern was the event publishing between the point of transaction commit and the broker's acknowledgment. This uncertainty led to the proposal of a two-layer idempotency model as an alternative to the traditional outbox pattern. The outbox pattern, which writes events to a separate table and has a separate poller publish to the broker, is a reliable solution for most systems, but it comes with added complexity and operational overhead. For a settlement system with a short settlement window, this overhead may not be justified. The two-layer idempotency model addresses the issue in a different way. The first layer ensures correctness of causality by publishing messages only when the transaction is committed, thus preventing phantom messages. The second layer handles duplicate delivery by computing a SHA-256 checksum of incoming messages and checking them against Redis. If a message is a duplicate, it is discarded, turning at-least-once delivery into effectively-once processing. This approach is lightweight and does not require the same level of operational complexity as the outbox pattern. The two-layer idempotency model offers a balance between reliability and simplicity, making it a suitable choice for certain settlement systems.",
  "summary": "A few weeks ago I published a write-up on inverting the control flow of a settlement API: instead of the endpoint owning window semantics (batching, cutoffs, retries), it became a pure write-and-forget operation, and all of that coordination logic moved to a cold-path scheduler. One of the best responses I got was from a fellow engineer who pushed on the exact point that matters most in any…",
  "key_points": [
    "Two-layer idempotency model proposed as alternative to outbox pattern",
    "First layer ensures causality by publishing messages on transaction commit",
    "Second layer handles duplicates using SHA-256 checksum and Redis"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}