Dynamic Consistency Boundary in Marten, Part 1: The aggregate trap
The structural problem DCB solves: business rules that span multiple aggregates and cannot be defended by per-stream optimistic concurrency.
4 posts
The structural problem DCB solves: business rules that span multiple aggregates and cannot be defended by per-stream optimistic concurrency.
We build the coupon redemption command from Part 1 using Marten's DCB API: tag types, BoundaryAggregate, FetchForWritingByTags, and the explicit ConcurrencyException retry cycle.
We rebuild the redemption command from Part 2 using Wolverine.HTTP with a [WolverinePost] endpoint, where the HTTP route, the DCB consistency boundary, and the business decision live in one static method. Includes an Alba HTTP test.
Tag storage modes, the global-lock failure mode of over-broad queries, tag governance, schema evolution, incremental migration from existing aggregates, and when DCB is the wrong tool.