Microservices patterns have moved from theory to tooling in 2020. Three patterns—saga, CQRS, and API gateway—showed measurable value in production systems.
An API gateway sits between clients and microservices, handling routing, JWT validation, rate limiting, and SSL termination. By centralizing these functions, it prevents clients from depending directly on service topology. Azure API Management, Kong, and Nginx are common implementations.
I remember when we first put Kong in front of a fleet of 30 services handling about 12 000 requests per second. The initial configuration used the DB‑backed mode with PostgreSQL, and we hit a latency spike of 80 ms on the gateway because each request caused a DB round‑trip for route lookup. Switching to Kong’s DB‑less mode cut the extra latency to under 5 ms and let us scale the gateway pods to a CPU‑limited 70 % without adding more nodes. The trade‑off was losing dynamic route updates; we had to bake new routes into the config and redeploy, which added a 30‑second window of stale routing during a rollout.
The Backend-for-Frontend (BFF) pattern builds on this by creating client-specific gateways. A web BFF might optimize for browser clients, while a mobile BFF aggregates data to reduce network calls. Third-party BFFs can enforce API access policies without altering core services.
Saga orchestration uses a central coordinator to manage multi-step transactions. If a step fails, the orchestrator sends compensating actions to undo previous steps. Temporal.io (launched in 2020) provides durable workflows with automatic retries and state persistence for this pattern.
In one payment workflow we chained three services: credit‑check, ledger, and notification. The orchestrator would fire the credit‑check, then the ledger, and finally the notification. About 1.8 % of the runs hit a timeout in the ledger service, and the compensating action we wrote simply wrote a “revert” entry without checking if the credit‑check had already been rolled back. That left the system with dangling holds on customer accounts. We rewrote the compensation logic to be idempotent and to query the current state before acting, which added roughly 150 ms of extra processing but eliminated the orphaned holds. Using Temporal’s built‑in saga support saved us from re‑implementing the retry and state‑machine plumbing, but it also forced us to adopt its Java SDK and run a separate cluster, a cost we had to factor into capacity planning.
Event-carried state transfer reduces synchronous dependencies by embedding required data in events. When a service emits an OrderPlaced event, it includes customer details so consumers don’t need to query the source. This decouples systems but increases event size and requires consumer-side data normalization.
These patterns work best when paired with strong monitoring. For example, tracing through an API gateway reveals latency bottlenecks, while event logs help debug saga failures. Tooling like OpenTelemetry and Prometheus became critical for visibility.
Our alerting pipeline ran into noise when we started instrumenting every gateway hop with OpenTelemetry. The default bucket boundaries in Prometheus caused a flood of “latency > 100 ms” alerts even though the end‑to‑end latency was within SLA. We tuned the histograms to 20 ms, 50 ms, 100 ms, and 250 ms buckets and added a rate‑of‑change condition, which cut the alert volume by 70 %. On the tracing side, we forced all services to propagate a X‑Request‑Id header, which let us stitch together a full request path in Jaeger and pinpoint a 30 ms slowdown in a downstream cache that was being evicted too aggressively.
I’ve seen teams overuse BFFs for every client type, creating maintenance debt. A better approach is to standardize on a core API and layer BFFs only where performance or security demands it.
The 2020 reality: no pattern is a silver bullet. Saga orchestration handles long-running workflows but requires careful error handling. Event-driven systems offer loose coupling but demand discipline in schema management. The right choice depends on trade‑offs specific to your context.