Microservices Patterns/Service Mesh & East-West Traffic

Traffic Management & Mesh Observability

VirtualService/DestinationRule, canary weights at mesh layer, fault injection, golden metrics per service pair.

4/5Overview: 30m

Istio traffic management

VirtualService — routing rules: weights, headers, faults DestinationRule — subsets (v1/v2), load balancing policy (LEAST_REQUEST, ROUND_ROBIN)

# 90/10 canary example (conceptual) route: - destination: payments-v1 weight: 90 - destination: payments-v2 weight: 10

gRPC and mesh

gRPC requires L7-aware balancing — mesh/Envoy handles endpoint-aware routing. Naive TCP LB fails (Service Discovery topic).

Fault injection (testing)

Mesh injects delays/abort percentages to validate resilience without app code changes. Use in staging; guard prod with extreme care.

Circuit breaking at mesh

Outlier detection — eject unhealthy hosts from pool after consecutive 5xx. Complements app-level circuit breakers; can conflict if both aggressive.

Observability hooks

Mesh emits:

  • Request count, latency histogram per source → destination
  • mTLS handshake failures
  • Retry counts

Export to Prometheus/Datadog; correlate with Observability → Distributed Tracing (trace context propagated by Envoy).

xDS (Envoy discovery)

Control plane pushes:

  • CDS — clusters
  • EDS — endpoints
  • RDS — routes
  • LDS — listeners

Enables global traffic shifting without redeploying sidecars' static config.

When mesh traffic management beats app deploy

  • Canary by percentage without multiple gateway routes
  • Mirroring — copy production traffic to v2 shadow
  • Regional failover — shift traffic to healthy region

Platform Deployment topic covers rollout strategy; mesh is the mechanism.

Further Reading

Hands-On Tasks (Optional)

Architecture drills and whiteboard exercises. Assumes Communication & Data Transfer and Distributed Systems fundamentals.

  • Design mesh canary rollout

    v2 of payments service: 1% → 10% → 50% → 100% traffic via DestinationRule subsets. Rollback trigger on error rate SLO burn.

    15m