Alchemy adds Decision for cross-aggregate transactions
Alchemy introduced Domain.Decision, a new domain-driven design primitive that enables atomic commands across multiple aggregate instances. Inspired by dynamic consistency boundaries, the mechanism coordinates two-phase commits across distributed runtimes like Cloudflare Durable Objects and Effect Cluster so all affected events commit together or fail cleanly.
Traditional domain-driven design confines transactions strictly to individual aggregates, forcing engineers to manage complicated sagas or accept eventual consistency for routine multi-entity operations like balance transfers. Bringing dynamic consistency boundaries natively to TypeScript gives distributed systems builders true atomic multi-aggregate guarantees without operational sprawl.
- –Atomic cross-aggregate execution: Commands can read and mutate multiple aggregate instances simultaneously, ensuring every event commits or the entire operation rolls back.
- –Primary-driven two-phase commit: Distributed environments like Cloudflare and Rivet use an idempotent two-phase commit protocol where the primary instance drives consensus without timeout dependencies.
- –Compile-time boundary validation: Static TypeScript types inspect aggregate dependencies via reads declarations, catching missing aggregates and conflicting command implementations at build time.
- –Breaking command API overhaul: Commands eliminate the explicit target parameter in favor of an aggregate-level keyOf mapping, streamlining call sites and event scheduling.
DISCOVERED
37m ago
2026-11-20
PUBLISHED
1h ago
2026-11-20
RELEVANCE
AUTHOR
samgoodwin89