Part 09 · Revision sheet

Microservices and Architecture Patterns

Key Terms

  • Conway's law — systems mirror the communication structure of the organizations that build them (→ 145)
  • Database per service — each service is the sole owner of its data; no other service touches its tables (→ 146)
  • Backend for Frontend (BFF) — a per-client-type aggregation layer that composes and reshapes domain-service calls (→ 148)
  • Sidecar — a helper process beside each service instance handling cross-cutting plumbing: TLS, retries, telemetry (→ 149)
  • Ambassador — a sidecar specialized as an outbound proxy, standing in for a remote dependency (→ 149)
  • Service mesh — sidecars fleet-wide plus one control plane configuring them consistently (→ 150)
  • Circuit breaker — stops calling a failing dependency once failures cross a threshold, failing fast instead (→ 151)
  • Exponential backoff with jitter — retries spaced out and randomized so simultaneous retriers don't collide (→ 152)
  • Bulkhead — isolated resource pools per dependency, so one slow dependency can't drain every pool (→ 153)
  • Graceful degradation — reduced behavior (stale data, a default, a disabled feature) decided in advance, not an error (→ 154)
  • CQRS — separate write model from one or more read models, kept in sync by events (→ 155)
  • Strangler fig — a facade routes functionality to a new system incrementally until the legacy system is retired (→ 156)

Decision Rules

  • Start from the modular monolith; split into services only when team scale or divergent scaling/deployment needs force it (→ 143)
  • Decompose along business capability and bounded contexts, never technical layers or database tables (→ 144)
  • Name the one team that owns each service end to end, or treat the boundary as premature (→ 145)
  • Default queries to synchronous calls and workflows/fan-out to asynchronous events; budget every synchronous hop (→ 147)
  • Add a BFF only when two or more client types have genuinely different needs; one client type needs just a plain API (→ 148)
  • Adopt a service mesh only once fleet size makes cross-cutting consistency its own burden; a few services need just a gateway plus a shared library (→ 150)
  • Retry only idempotent operations, and only failures that are plausibly transient (→ 152)
  • Reserve CQRS for when read and write shapes have genuinely diverged; try a read replica first (→ 155)
  • Match the modernization approach to the actual pressure: rehost before replatform before refactor before rebuild (→ 157)

Numbers & Formulas

  • Exponential backoff: wait = base × 2^attempt; e.g. base 1 s, attempt 3 yields an 8 s wait before the 5th attempt (→ 152)
  • Synchronous call-chain latency adds: 3 sequential calls at 50 ms each is 150 ms minimum before mitigation (→ 147)

Traps

  • The distributed monolith: services split but still deploying together because they share a database or a chatty synchronous chain (→ 143, → 146)
  • Entity services (a "Customer service" called for everything) becoming a shared-everything bottleneck (→ 144)
  • Retrying without jitter — synchronized retries become the retry storm they were meant to prevent (→ 152)
  • A circuit-breaker threshold set too loose lets caller-resource exhaustion happen before the breaker ever opens (→ 151)
  • Degrading an essential dependency "gracefully" into a wrong answer instead of failing clearly (→ 154)

Self-Quiz

  1. Can you name the specific pressure that justifies splitting a monolith, or defend staying modular when none exists? (no → revisit 143)
  2. Can you draw service boundaries by bounded context and defend each by the business reason it exists? (no → revisit 144)
  3. Can you classify five interactions as synchronous or asynchronous and total a chain's latency budget? (no → revisit 147)
  4. Can you implement a circuit breaker's three states and name the caller's fallback while it's open? (no → revisit 151)
  5. Can you decide, for a stated workload, whether CQRS or a simple read replica is the right fix? (no → revisit 155)

Search the guide