Software Architect / Tech Lead · Focus area 2: Technical strategy
AR6: Reliability across services: deadlines, retries, idempotency, outboxes and contracts
Goal: design calls between services that survive slow and failing networks: deadlines, sensible retries, circuit breakers, idempotency keys, an outbox for work that can't be done now, and contracts that callers can rely on.
You'll need: AR2, AR5, Module 24 (Asynchronous Programming), Module 47 (REST API Design), Module 94 (Distributed Systems), Module 96
(Reliability Engineering), and the RasoiRoute practice kit (services/notify, contracts/notify-v1.json).
Where this is used: payments, messaging, bookings, and anywhere one system calls another over a network. Most outages between services aren't caused by a service being down, but by it being slow, or by a retry doing something twice.
How it differs: inside one process, a function call either returns or throws. Across a network there's a third outcome: you don't know. This module is about designing for that.
Time: reading about 3 hours · practice (the Try it tasks) about 3 hours · assignment about 4 hours.
Lessons
- 1Networks fail in partial waysReading 15–25 minutes, plus practice✓
- 2Deadlines, retries and circuit breakersReading 15–25 minutes, plus practice✓
- 3Idempotency keysReading 15–25 minutes, plus practice✓
- 4The outboxReading 15–25 minutes, plus practice✓
- 5Contracts and versionsReading 15–25 minutes, plus practice✓
🛠️Assignment: Make notifications survive the network
- Build the notify service to
contracts/notify-v1.json, with health checks, validation and idempotency. - Add the remote client with a 500 ms deadline, treating 5xx and timeouts as "try later" and 4xx as "failed".
- Add a durable outbox and
drainOutbox(), removing messages only after success. - Run
npm run test:extractionand fix until 10 of 10 pass. - Write two paragraphs: what happens to an order when the service is slow, and why a duplicate in the outbox doesn't reach the customer.
Self-check before you finish:
- [ ] No order waits more than about half a second for messaging (test 7).
- [ ] The same key twice stores one message (test 3).
- [ ] A drain sends each message once and empties the outbox (test 8).
- [ ] Every error reply has an
errorfield (test 2).
✅Module check
Explain in a few sentences, in your own words:
How do you make one service's calls to another safe when the network is unreliable?
Show a good answer
A good answer mentions: three outcomes (success, failure, unknown) and slowness spreading; a deadline on every call chosen from what the caller can afford; retries only for brief failures and safe requests, with exponential backoff, jitter and limits; circuit breakers; idempotency keys derived from the action, stored long enough, with repeats answered with the stored result; a durable outbox drained later with at-least-once delivery, removed only after success, and watched; and a written contract with clear errors, contract tests, health checks and versions for breaking changes.
📚Official references
Official documentation and guidance for this module's topics, chosen on 2 November 2026. Tools, laws and standards change, so check the current version before you rely on a detail. If a link has moved, search the same site.
📝Module quiz
10 questions · 10 marks each · 100 marks in all · pass mark 70% · retry as often as you like ·
