Microservices Patterns Overview

A synthesis page mapping the common challenges in microservices architecture to the patterns that address them, providing a navigable reference for the full pattern landscape.

Core Characteristics of Microservices

Microservices architecture decomposes an application into small, independently deployable services. Key characteristics:

  • Each service owns its own database (Database per Service).
  • Services communicate over the network (HTTP, gRPC, messaging).
  • Services are independently deployable and scalable.
  • Each service is organized around a business capability (Bounded Context in DDD).

Challenge Map: Problems → Patterns

Challenge: Data Consistency Across Services

Without a shared database or global transaction, keeping data consistent is the hardest microservices problem.

PatternDescription
Saga PatternChoreography or orchestration-based sequences of local transactions with compensating rollbacks
Outbox PatternAtomic state + event publication in one database transaction
Inbox PatternDeduplication of incoming events on the consumer side
IdempotencyOperations safe to replay without duplicate side effects
Eventual ConsistencyAccept that replicas converge over time rather than immediately
Distributed Transactions2PC for strong consistency (with availability trade-offs)

Challenge: Service Reliability & Fault Tolerance

In distributed systems, failures are the norm, not the exception.

PatternDescription
Circuit Breaker PatternTrip open when a dependency fails; prevent cascading failures
Bulkhead PatternIsolate resource pools; contain blast radius
Resiliency PatternsRetry, timeout, fallback, hedging — layered defense
BackpressureFlow control: consumers signal capacity to producers

Challenge: Service Communication

Services must discover each other and communicate reliably.

PatternDescription
API Gateway PatternSingle external entry point; cross-cutting concerns centralized
Backend for Frontend PatternPer-client-type API tailored to specific needs
Service MeshInfrastructure for east-west communication (mTLS, retries, tracing)
Sidecar PatternPeripheral concerns in a co-deployed proxy container
Ambassador PatternOutbound call management via a sidecar proxy

Challenge: Observability

With many services, debugging failures requires system-wide visibility.

PatternDescription
ObservabilityThree pillars: logs, metrics, distributed traces
Distributed TracingTrack requests end-to-end; identify latency bottlenecks

Challenge: Migration & Evolution

Moving from monoliths to microservices (or evolving existing microservices).

PatternDescription
Strangler Fig PatternIncrementally replace legacy with a façade
Anti-Corruption Layer PatternIsolate new system from legacy model corruption
Modular MonolithAn intermediate architecture before splitting into services

Challenge: Domain Modeling

Services must be cohesively scoped around business capabilities.

ConceptDescription
Bounded ContextDDD strategic boundary; often maps to one service
AggregateTransactional unit within a service
Domain EventCross-service communication via business facts
Event StormingWorkshop to discover service boundaries and events

Service Decomposition Strategies

  1. Decompose by business capability — one service per business function.
  2. Decompose by subdomain — use DDD subdomains; core domain gets the most investment.
  3. Vertical Slice Architecture — within a service, organize code by feature.

Technology Layers

LayerCommon Tools
Service meshIstio, Linkerd, Consul Connect
API gatewayKong, AWS API Gateway, Ocelot, Envoy
MessagingKafka, RabbitMQ, Azure Service Bus
Distributed tracingJaeger, Zipkin, OpenTelemetry
Resilience (.NET)Polly, Simmy
Actor frameworksOrleans, Akka.NET, Proto.Actor