Cheatsheets
Microservices
Patterns, communication, data, and resilience for microservice architectures — with a reference diagram.
Visualize
Raft — leader election & log replication (3D)
One elected leader serializes writes; a log entry commits once a majority of nodes replicate it.
27 entries
Decomposition & patterns8
API GatewaySingle entry point: routing, auth, rate limiting.
Backend for Frontend (BFF)A gateway tailored per client (web/mobile)
Database per serviceEach service owns its data; no shared DB.
SagaCoordinate a multi-service transaction via events + compensation.
CQRSSeparate read and write models
Event sourcingPersist state as a log of events
Strangler figIncrementally replace a monolith
SidecarCo-process for cross-cutting concerns (e.g. proxy)
Communication5
REST / gRPCSynchronous request/response (gRPC = fast, typed)
Async messagingQueues/topics decouple producers & consumers
Event-drivenReact to domain events; loose coupling
Service meshSidecars handle mTLS, retries, routing (Istio, Linkerd)
Service discoveryFind instances dynamically (DNS, Consul)
Data & consistency4
Eventual consistencyState converges over time, not instantly
Outbox patternAtomically persist state + the event to publish.
Idempotency keysMake retried writes safe to repeat.
Distributed transactionAvoid 2PC — prefer sagas + compensation
Resilience5
Circuit breakerStop calling a failing dependency so it can recover.
Retry + backoffRetry transient failures with jitter
BulkheadIsolate resources so one failure won't sink all
TimeoutBound every remote call
Rate limitingProtect services from overload
Observability & delivery5
Distributed tracingFollow a request across services (OpenTelemetry)
Correlation IDPropagate a request id through all hops
Health checksLiveness & readiness probes
Centralized loggingAggregate structured logs (ELK, Loki)
Blue-green / canaryRelease strategies that limit blast radius