Durable execution guarantees correct program output despite system failures. This guide demonstrates implementing durable execution in Go using SQLite and Watermill by persisting input events immediately after validation, ensuring idempotent event handlers through database constraints and deduplication, and proving atomicity with chaos engineering tests. The approach uses SQLite's persistent storage as a drop-in replacement for ephemeral backends, combined with the outbox pattern and single-transaction handlers to achieve reliable recovery from network outages, service failures, and other interruptions.

11m read timeFrom threedots.tech
Post cover image
Table of contents
What is Durable Execution?Durable Execution Requires Immediate Input StorageStash the Input After Parsing and ValidationProve Idempotency with Event DuplicationProve Atomicity with Chaos EngineeringConclusion

Sort: