Nothing here is a diagram you scroll past. Every module injects a concrete failure into a small service mesh — latency, a 500, a stale reservation — and makes you watch the state machine, the compensation, and the trace respond.
Decompose along business capabilities and give every service its own datastore; cross a boundary only through a published contract or a domain event.
The two failure modes the map opens with: a shared database (a distributed monolith) and a service per table (too granular to own anything).
Run a distributed RPC across Gateway → Order → Payment → Inventory under one of three scenarios: healthy flow, latency (+2.5s), or a service crash returning 500.
How a slow hop consumes the caller’s threads, and how bulkhead isolation keeps it from draining the whole chain.
Drive the three-state breaker by hand: three failures inside a five-call sliding window trip it OPEN for a five-second cooldown, then a single HALF_OPEN canary decides.
Fail-fast collapsing to a 0 ms fallback, the cooldown countdown, and a canary failure sending the breaker straight back to OPEN.
Run the four-step order saga and fail it at any step: create order, reserve stock, charge payment, dispatch courier — then watch the reverse compensations fire.
That a compensating action is a new forward business action (release stock, refund, cancel), not a database ROLLBACK — and that consumers must be idempotent.
Follow one W3C traceparent from the gateway through synchronous RPCs and the asynchronous queue, and read the span waterfall it reconstructs.
Context propagation across background workers, and why tail-based sampling — not 100% sampling — keeps the error traces.
Same topology as the home-page mesh, read as a risk table: what each service owns, what it does to the rest of the system when it degrades, and the containment that is supposed to hold.
| Service | Responsibility | Fails as | Contained by |
|---|---|---|---|
| API Gateway | Routing, auth, rate limiting | Absorbs every slow downstream call into its own worker pool | Bulkhead thread pools, timeouts, fallback routing |
| Order Service | Saga orchestrator FSM | A stalled step strands the order in PENDING with no owner | Compensating transactions, idempotent command consumers |
| Payment Service | Stripe gateway wrapper | 500s and 2.5 s latency spikes drag the whole checkout down | Circuit breaker fallback, asynchronous retry queue |
| Inventory Service | PostgreSQL stock ledger | Reservations leak when a later step in the saga fails | Release-stock compensation, expiring reservations |
Trip a breaker, then roll a saga back, then read the trace.