ADR-BW-012: Select resilience according to operation semantics
Use shared outbound defaults and capability-specific failure handling without equating retries or duplicate guards with exactly-once effects.
| Field | Value |
|---|---|
| Status | Proposed |
| Date | 2026-11-07 |
| Owners | Platform Engineering TeamTeamPlatform Engineering TeamPlatform team providing BookWorm's thinnest viable platform—orchestration, messaging fabric, scheduling, notifications, ...Open docs |
| Affected Resources | BookWormDomainv1.0.0BookWormCore e-commerce domain for the BookWorm online bookstore, coordinating catalog discovery, customer baskets, order fulfil...Ownerarchitecture-enabling-teamDiagramRepositoryOpen docs |
| Related ADRs | ADR-BW-008: Persist configured broker handoffs with local inboxes and outboxesDecision Recordv1.0.0ADR-BW-008: Persist configured broker handoffs with local inboxes and outboxesUse the shared event framework's per-service durable message storage without claiming exactly-once business effects.Ownerplatform-engineering-teamOpen docs, ADR-004: Bound placement retries with scheduled saga timeoutsDecision Recordv1.0.0ADR-004: Bound placement retries with scheduled saga timeoutsFinance uses Wolverine timeout messages and a persisted counter to bound placement-command reissues, cancelling only the...Ownercommerce-fulfillment-teamOpen docs, ADR-003: Make scheduled jobs misfire-aware and safe to repeatDecision Recordv1.0.0ADR-003: Make scheduled jobs misfire-aware and safe to repeatScheduled jobs use explicit misfire handling, bounded execution, and target-side idempotency so restarts, timeouts, and ...Ownerplatform-engineering-teamOpen docs, ADR-002: Use a durable outbox with bounded provider retriesDecision Recordv1.0.0ADR-002: Use a durable outbox with bounded provider retriesNotification delivery attempts are driven by durable outbox records and a bounded retry policy so provider outages do no...Ownerplatform-engineering-teamOpen docs |
Context & Problem Statement
Transient network or provider faults affect read queries, checkout writes, scheduled batches, and SMTP email delivery differently. Applying identical aggressive retries everywhere can duplicate orders or emails, while disabling retries altogether turns brief blips into customer-visible outages.
Decision Drivers
- Transient recovery: Absorb brief network or dependency hiccups automatically.
- Side-effect safety: Prevent blind retries from duplicating orders, charges, or emails.
- Bounded failure: Enforce timeouts, circuit breakers, and dead-letter queues so outages stay visible.
Options Considered
| Option | Pros | Cons |
|---|---|---|
| Shared outbound defaults + operation-specific resilience | Safe retries for reads; idempotency/circuit-breakers/DLQs for writes | Each integration must review its timeout and retry semantics |
| Uniform aggressive retries everywhere | Simple global policy | Duplicates non-idempotent side effects and amplifies outages |
| Zero retries anywhere | Never repeats an external call | Brief transient blips cause immediate user-facing failures |
| Assume idempotency guards guarantee exactly-once | Simpler mental model | Time-bounded guards and external SMTP timeouts cannot guarantee exactly-once |
Decision & Consequences
Chosen Option: Apply shared outbound resilience defaults (timeouts, jittered retries, circuit breakers) tailored to operation semantics—combining idempotency keys, bounded saga retries (Order OrchestrationServicev1.0.0Order OrchestrationMessage-driven Finance workflow service that coordinates post-checkout basket cleanup and order notifications using Dura...PublishesPlaceOrderCommand, DeleteBasketCompleteCommand +3SubscribesUserCheckedOutIntegrationEvent, OrderStatusChangedToCompleteIntegrationEvent +3APIsAsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs), misfire policies (Scheduler ServiceServicev1.0.0Scheduler ServiceSingle-host Quartz.NET job execution engine and operational dashboard UI for scheduling recurring platform jobs and insp...PublishesProcessVectorBatchIntegrationEventAPIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs), and DLQs (Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs) without claiming exactly-once external side effects.
- Positive: Read paths recover transparently while stateful and external integrations remain protected against amplification and silent loss.
- Negative: Every new outbound client or consumer must explicitly configure and document its retry/timeout bounds.
Compliance Criteria
- Non-idempotent write endpoints (such as order creation) must require client idempotency keys (
x-request-id). - Outbound HTTP/gRPC/SMTP clients must configure explicit timeouts and circuit breakers.
- Architecture and operational docs must describe at-least-once delivery with idempotent handling rather than claiming exactly-once.