Effect Two-Phase Commit
The commit protocol that will not leave money half-transferred across services. Telling three services commit now in a loop works until the second refuses, and then the first has committed and there is no way back. Two-phase commit splits the write into a prepare round (every participant durably stages and votes) and a commit round that only starts on unanimous yes, so a refusal aborts everyone. The decision is written to a durable log before any commit message is sent, so a coordinator crash blocks but never forks: recovery re-delivers the logged decision. The demo shows one-phase commit minting 150 from nothing versus 2PC conserving every cent. Pinned to effect 4.0.0-beta.98.
npx shadcn@latest add https://ui.aryank.space/r/effect-two-phase-commit.jsonInstalls from ui.aryank.space. To add it by hand, copy the files in Files below, or register the @compronents namespace via the docs.
Phase 1: every participant durably stages and votes yes. Only then does phase 2 commit them all. Both sides move together, total conserved to the cent.