Production Microservices
Production .NET microservices use Dapr for portable service communication, OpenTelemetry for distributed tracing, event-driven patterns with the saga pattern, and health checks for orchestrator integration.
40 min•By Priygop Team•Last updated: Feb 2026
Production Microservice Patterns
- Dapr — Portable runtime sidecars for service invocation, pub/sub, state, secrets. Swap RabbitMQ for Azure Service Bus with config, no code changes
- OpenTelemetry — Instrument once, send to any backend. builder.Services.AddOpenTelemetry().WithTracing(...).WithMetrics(...)
- Health checks — app.MapHealthChecks('/health/live') for liveness, '/health/ready' for readiness. Checks: DB connectivity, queue lag, disk space
- Polly resilience — Retry: .AddRetry() with exponential backoff. Circuit breaker: .AddCircuitBreaker(). Timeout: .AddTimeout(TimeSpan.FromSeconds(5))
- Saga — Choreography: services react to events (OrderCreated → InventoryReserved → PaymentProcessed). Orchestration: Saga orchestrator coordinates the flow
- Distributed cache — IDistributedCache backed by Redis. Cache frequently-read data, invalidate on change. Output caching for HTTP responses