Best-Effort One-Phase Commit and the Dual-Write Problem

Distributed applications frequently need to coordinate operations across multiple transactional resources. A service might update a database and acknowledge a message, or persist a record and invoke a remote API. The challenge is that these operations are independent. A successful database commit does not guarantee that a message acknowledgement or remote API call will succeed. One commonly adopted strategy is best-effort one-phase commit (1PC). Rather than introducing a distributed transaction coordinator, it relies on careful transaction ordering and idempotent processing to reduce the risk of inconsistent outcomes. ...

May 15, 2024 · 12 min · Kai Niemi

Designing Idempotent REST APIs: Stateless Preconditions and Idempotency Keys

How do you safely retry a POST request when the outcome is unknown? A comparison of stateless preconditions and idempotency keys, using funds transfers as an example.

October 19, 2022 · 15 min · Kai Niemi