Skip to content

Design Questions and Pattern Map

The building blocks are organized as design questions, following the structure of a pattern language such as microservices.io. Each hub states one question, the forces that bear on it, and the competing options. Each option changes the design in a way that raises the next question. Following those links from one hub to the next is what makes the collection a language rather than a catalog.

The original topic collection records where each pre-refactor topic went and maps the Educative and interviewing.io building-block lists onto these hubs.

The hubs

HubQuestion
Architecture style and service boundariesOne deployable unit or several? Where do the boundaries go? How do you migrate?
Data across servicesWho owns the data? How do operations and queries span services? How are changes published reliably?
Service communicationSynchronous or asynchronous? Which mechanism? How are duplicates handled?
The request pathHow does a request reach a healthy instance of the right service?
Containing failureHow do you stop a slow or failing dependency from spreading?
Data at scaleHow do you store and serve more than one machine can?
Operating servicesWhat does each service need to be deployed, configured, observed, secured, and tested?

Where the microservices.io groups went:

microservices.io groupHub
Architectural style, service boundaries, refactoring to servicesBoundaries
Service collaboration, transactional messagingData across services
Communication stylesCommunication
External API, service discoveryRequest path
ReliabilityContaining failure, extended with Nygard’s and Newman’s patterns
Deployment, cross-cutting concerns, observability, security, testing, UI designOperating services
(not covered)Data at scale: replication, partitioning, caching, identifiers, rate limiting

Hub and pattern format

Each hub:

  1. Question: the problem the options answer.
  2. Forces: the qualities and constraints that push toward one option or another. Link the relevant NFR notes; a quality is a force, not a container for patterns.
  3. Options: for each pattern, how it works, when it fits, and what it costs, including the next question it raises.
  4. Leads to: the hubs those consequences point to.
  5. Seen in cases: where a practice case uses or needs the pattern.
  6. Gaps: what is not yet understood or written.
  7. Sources: the pattern pages and book chapters.

A single pattern gets its own note only when there is substantial material for it, as with the API gateway and messaging. Until then it lives as a row in its hub. For such a note, record:

  1. The problem it solves and a concrete use case.
  2. How it works, including the important request or data flow.
  3. The assumptions and constraints under which it is useful.
  4. Trade-offs, failure behavior, and alternatives.
  5. What it leads to: the problems it creates and the patterns that address them.
  6. Relevant implementations and examples from practice cases.

Keep concepts separate from product names. Use a specific implementation to deepen the explanation when its behavior matters.

How the questions connect

Four chains run through the hubs. Each step is a consequence of the one before.

  1. Splitting data: microservices -> database per service -> sagas and API composition or CQRS -> domain events -> transactional outbox -> idempotent consumer.
  2. Calling across the network: remote procedure invocation -> service discovery and an API gateway -> timeouts, retries, and circuit breakers -> idempotency.
  3. Running many services: more deployable units -> a deployment platform -> a chassis or a service mesh -> distributed tracing.
  4. Growing one service’s data: growth -> replication, partitioning, and caching -> consistency questions -> reliable propagation to caches and replicas.

For prototyping, defaults and triggers gives one starting option per hub, the signal to move past it, and the technique that tests the move. Common trade-offs lists the pairs that recur across hubs.

Same patterns in other domains

The same forces recur at other scales and in other kinds of systems. Some rows below are close correspondences; others are interpretations, marked as such.

System design patternIn the engineering notesIn AI and RAG designs
Start with one deployable unit and split when a force demands it (boundaries)Model concrete workflows before committing to shared abstractions: premature abstraction, YAGNI, AHA. The same force acts at module scale, as in Khononov’s view of coupling at every scale.Independently testable modules in the boundary map for a RAG and tool assistant
Contracts between services and consumer-driven contract tests (communication, testing)Contracts and invariants in the test strategyTools and retrieval treated as versioned APIs with error semantics; tests as an architectural force (design pressure)
One entry point that routes and applies shared policies (request path)n/aThe request-and-routing module of the boundary map; layers 0-2 of the RAG runtime: normalization, policy, routing and planning
Bounded retries, fallbacks, and caps (containing failure)n/aBounded retries in the tool runtime; fallback or repair after invariant checks; the recursion limit in the deterministic agent template
System of record versus a derived view (data across services)n/a“Authoritative tools beat doc retrieval” in the RAG runtime; the index with freshness targets, versioning, and invalidation. Reading the index as a CQRS-style read model is an interpretation.
Service template versus microservice chassis; externalized configuration (operating services)Golden paths, which prefer copied scaffolding to an internal library; Twelve-Factor; the service-readiness layer of the operating modelThe observable RAG, deterministic agent, and eval harness templates
Gradual release and change tracking (operating services)Feature flags, canaries, and dark launches in the lifecycle techniques and deployment notesBlast-radius control through versioned prompts, models, indexes, and tool schemas released behind flags
Start simple and move on when a trigger fires (defaults and triggers)Choose the technique by the risk being reduced (lifecycle techniques)The hierarchy of needs in the RAG runtime: no AI, then an LLM transformation, then a system of record, then retrieval, then ask or abstain

Patterns and techniques share one record

A structure pattern answers what to build; a process technique answers how to learn whether it is right. The hub format above and the technique record in the delivery techniques guide record the same kinds of things:

Hub fieldTechnique record field
Question and forcesGoal and primary risk
MechanismWhat must be real; what can be simplified
CostsExpected lifespan; non-goals
Leads toDecision or next step
GapsRecord what remains unknown

That shared shape is what lets the flow alternate between the two: pick an option, test it with a technique, record the decision and its trigger.

Where detail lives

Not yet placed

Common design templates, such as a CRUD service and a management interface, do not fit a single hub yet. The control plane now has its own pattern note. Each hub lists its own gaps.

Each hub’s options table holds the trade-offs for its own question. The ones that recur across hubs, such as consistency versus latency, SQL versus NoSQL, and push versus pull, are collected in common trade-offs, with the signal that tips each one.

Use practice to decide which gap to study next.

Pattern catalogs

Library sources

  • Richardson 2019, Microservices Patterns: With Examples in Java – the pattern language the hubs follow