Roadmap › 1. .NET › Step 27
MS

Microservices & System Design with .NET

Monolith vs modular monolith vs microservices, service boundaries (DDD), REST/gRPC and messaging, API gateways, data per service, sagas and the outbox pattern, resilience, observability, caching, scaling and the system-design interview round.
What it is & where it is used

Microservices is an architectural style where an application is built as a set of small, independently deployable services, each owning one business capability and its own data, communicating over the network (HTTP/gRPC or messages).

StyleWhat it isGood for
MonolithOne deployable unit, one databaseSmall teams, early products — simple to build, test and deploy
Modular monolithOne deployable, but strict internal modules (own schema, public interfaces)Most business apps; easy to split later
MicroservicesMany deployables, each with its own data and pipelineLarge organisations, parts with very different scaling/release needs

System design is the interview round where you design a whole system (requirements → APIs → data → components → scaling → trade-offs). Microservice concepts (queues, caches, gateways, consistency) are the vocabulary of that round.

In .NET the common toolset is: ASP.NET Core (REST/minimal APIs), gRPC, YARP (reverse proxy / gateway), MassTransit or NServiceBus over RabbitMQ / Azure Service Bus, Polly / Microsoft.Extensions.Http.Resilience, OpenTelemetry, Docker, Kubernetes/AKS or Azure Container Apps, and .NET Aspire for local orchestration and observability.

Versions & history
YearMilestone
2011–2014"Microservices" term popularised (James Lewis, Martin Fowler — article 2014)
2015–2017Netflix OSS, Docker and Kubernetes make the style mainstream
2017Microsoft eShopOnContainers reference app and the ".NET Microservices: Architecture for Containerized .NET Applications" guide
2019gRPC support in ASP.NET Core 3.0
2021YARP 1.0 reverse proxy
2023.NET 8: Microsoft.Extensions.Http.Resilience (built on Polly v8); .NET Aspire preview
2024.NET Aspire 8.0 GA (May 2024) — orchestration, service discovery, OpenTelemetry dashboard
2025.NET 10 and Aspire 9.x/13 — Aspire grows into a general app-host for distributed apps

Industry trend to mention: many teams moved back to modular monoliths after over-splitting (e.g. the Amazon Prime Video monitoring case study, 2023). Interviewers like candidates who choose microservices for a reason, not by default.

Lifecycle

Life of a request in a microservice system:

  1. Client → API gateway (YARP / Azure API Management): TLS, auth token validation, routing, rate limiting.
  2. Gateway → service A over HTTP/gRPC (service discovery finds an instance).
  3. Service A reads/writes its own database.
  4. Service A publishes an event (OrderPlaced) via the outbox to a message broker.
  5. Services B and C consume the event asynchronously and update their own data.
  6. Every hop carries a trace id (W3C traceparent) so one distributed trace shows the whole flow.

Life of a service: identify boundary (bounded context) → define contract (API/events) → build + tests → container image → CI/CD → deploy (rolling/blue-green/canary) → monitor (logs, metrics, traces, alerts) → evolve contract with versioning.

Tools used to develop
  • Communication: ASP.NET Core Web API / minimal APIs, gRPC, SignalR, YARP, Azure API Management, Ocelot (older).
  • Messaging: RabbitMQ, Azure Service Bus, Kafka / Azure Event Hubs, MassTransit, NServiceBus, Wolverine.
  • Resilience: Polly, Microsoft.Extensions.Http.Resilience (retry, circuit breaker, timeout, hedging).
  • Observability: OpenTelemetry, .NET Aspire dashboard, Application Insights, Prometheus + Grafana, Jaeger/Zipkin, Seq.
  • Hosting: Docker, Kubernetes / AKS, Azure Container Apps, Dapr (sidecar building blocks).
  • Data & cache: SQL Server / Azure SQL, Cosmos DB, PostgreSQL, Redis.
  • Design: C4 model diagrams, Event Storming for DDD boundaries.