Home

/

The Production-Ready Playbook

/

Altitude 4: Messaging & Scale

Altitude 4: Messaging & Scale

Appendix C
Appendix
3
min read

Altitude 4 — Messaging & Scale

Primary sources: Azure Cloud Design Patterns (https://learn.microsoft.com/azure/architecture/patterns/) and Hohpe, Gregor; Woolf, Bobby. Enterprise Integration Patterns (EIP). Addison-Wesley, 2003. https://www.enterpriseintegrationpatterns.com/

  • Queue-Based Load Levelling — Azure Cloud Design Patterns. https://learn.microsoft.com/azure/architecture/patterns/queue-based-load-leveling Absorb the lunch/dinner rush.
  • Competing Consumers — Azure Cloud Design Patterns (https://learn.microsoft.com/azure/architecture/patterns/competing-consumers); EIP. A pool of workers draining the courier-assignment queue.
  • Publish/Subscribe — Azure Cloud Design Patterns (https://learn.microsoft.com/azure/architecture/patterns/publisher-subscriber); EIP Publish-Subscribe Channel. OrderPlaced fans out to kitchen, courier, customer, and analytics.
  • Transactional Outbox — Chris Richardson, microservices.io. https://microservices.io/patterns/data/transactional-outbox.html The reliable bridge between the order's database transaction and the broker.
  • Dead-Letter Queue / Backpressure — EIP Dead Letter Channel; Reactive Streams backpressure (https://www.reactive-streams.org/). Where an unprocessable order event lands.
  • Saga / Process Manager — Hector Garcia-Molina & Kenneth Salem, "Sagas," ACM SIGMOD, 1987 (https://www.cs.cornell.edu/andru/cs711/2002fa/reading/sagas.pdf); Chris Richardson, microservices.io (https://microservices.io/patterns/data/saga.html). Order fulfilment as charge → assign courier → confirm with restaurant, with compensations (refund) on failure. Heavy skip-if.
  • Claim-Check — EIP (https://www.enterpriseintegrationpatterns.com/patterns/messaging/StoreInLibrary.html); Azure Cloud Design Patterns (https://learn.microsoft.com/azure/architecture/patterns/claim-check). Store the large receipt, pass a token.
  • Honorable mentions — Idempotent Consumer (see Altitude 5); Event-Carried State Transfer (Fowler, https://martinfowler.com/articles/201701-event-driven.html); Priority Queue (Azure Cloud Design Patterns).
  • Brokers (neutral) — GCP Pub/Sub · AWS SQS + SNS · Azure Service Bus.
OrderPlaced fanned out

Altitude 5 — Resilience

Primary source: Nygard, Michael T. Release It! Design and Deploy Production-Ready Software. 2nd ed., Pragmatic Bookshelf, 2018. Library: Polly (https://www.pollydocs.org/).

  • Circuit Breaker — Nygard, Release It!; Fowler bliki. https://martinfowler.com/bliki/CircuitBreaker.html Stop calling a failing payment provider.
  • Bulkhead — Nygard, Release It! Isolate surge-pricing calls from order placement so one can't sink the other.
  • Timeout — Nygard, Release It! Bound the wait on the payment gateway.
  • Steady State — Nygard, Release It! Bound every growing resource: purge old courier GPS pings, cap the courier-location cache, rotate logs. Honorable mentions here: Graceful Degradation, Load Shedding, Failover / Redundancy.
  • Retry with exponential backoff + jitter — Marc Brooker, AWS Architecture Blog, "Exponential Backoff And Jitter." https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ Retry a flaky payment authorisation without stampeding.
  • Rate Limiting / Throttling — Azure Cloud Design Patterns (https://learn.microsoft.com/azure/architecture/patterns/throttling); .NET rate limiting (System.Threading.RateLimiting). Cap the public order API.
  • Idempotency — idempotency keys, Stripe API documentation (https://stripe.com/docs/api/idempotent_requests; illustrative). The property that makes a retried order placement safe: never double-charge, never double-place.

The compounding-failure illustration (95% per-step success over N steps = 0.95^N, roughly 60% at ten steps and 36% at twenty) is arithmetic, not a measured benchmark. Treat it as a worked example, never as a cited statistic.

The payment call, wrapped
the-pareto-stack-cloud-design-patterns-for-small-teams
the-ladder-of-altitudes
how-to-read-this
object-level-the-patterns-that-earn-their-keep
decorator
state
component-level-structuring-one-service
ports-and-adapters-hexagonal
mediator-the-commandquery-split
data-persistence
optimistic-concurrency
messaging-scale
outbox
resilience-staying-up-when-dependencies-dont
rate-limiting-throttling
timeout-fallback
the-composed-pipeline
observability-diagnostics-seeing-inside-production
metrics-the-four-golden-signals
externalised-configuration
hosting-cloud-agnostic-by-default
sidecar-ambassador
orchestrator-agnostic-deploy
a-reference-service
the-relay-outbox-to-queue
the-payment-saga-charge-pay-out-compensate
the-over-engineering-tax
conclusion-production-ready-deliberately
the-pattern-quick-reference-card
altitude-3-data-persistence
altitude-5-resilience
the-skip-list
full-event-sourcing-for-crud
robert-c-martin-uncle-bob-the-house-authority-for-structure
altitude-2-component
altitude-4-messaging-scale
altitude-6-observability-diagnostics

Download the full PDF for free?

Free download — no account required

Get the PDF
Get the PDF
Related Chapters
Free Download
Get the full PDF
All pages, including all code examples, diagrams, and the appendix reference card.
No spam. Unsubscribe at any time.
Your email won't be shared.
Oops! There's a problem with your request. We're working on fixing it. Please try again later.