Overview

1 Getting Started with Distributed Systems and Aspire

Running a distributed application is much harder than running a single app because its pieces must be started, configured, connected, and observed together. The chapter uses an online shop as the running example to show how a storefront, API, database, cache, broker, background services, and telemetry all cooperate as one system, even though they execute independently. It explains that Aspire helps .NET developers manage this complexity by giving them one place to model the whole system, launch its parts, debug them, and view logs, traces, health, and status in a shared dashboard.

The chapter then steps back to define what distributed systems are and why they are used. It contrasts distributed applications and microservices with monoliths and modular monoliths, noting that smaller services can improve deployment speed, scalability, flexibility, resilience, and maintainability, but they also add complexity, operational overhead, network-related failure modes, testing difficulty, performance cost, security concerns, and initial design effort. Orchestration is introduced as the coordination layer that handles deployment, scaling, load balancing, health monitoring, configuration, and resource allocation across those services, which is the role Aspire plays during local development.

Finally, the chapter introduces the Aspire starter project and shows how its main parts fit together: an AppHost orchestrator, a Blazor web frontend, an API service, and shared service defaults. It explains how the host registers projects, waits for dependencies, exposes only selected endpoints, and enables service discovery so the frontend can refer to the API by name instead of hardcoded address. It also outlines the shared defaults used for health checks, OpenTelemetry-based observability, and HTTP client resilience, setting up the foundation for the rest of the book’s gradual build-out toward a production-ready cloud application.

High-level overview of the system we are building
Example of a distributed application
Modular monolith structure
Orchestrated system
Hosting code and infrastructure components in the same Aspire process
The structure of the Aspire solution
Aspire dashboard
Aspire console log
Aspire Resources webfrontend link
Blazor app hosted in Aspire

Summary

  • Aspire was created by Microsoft to make the process of developing distributed applications easy.
  • Distributed applications are systems that consist of multiple independent services that interact with each other.
  • Orchestration is the process of coordinating services inside a distributed system
  • The main benefit of using Aspire is that it allows running and debugging a distributed application in a single process on a development machine, which substantially simplifies the development process
  • Aspire consists of the Aspire Host project, which all other projects can connect to
  • Different applications hosted by Aspire can pass each other’s references to each other when they are registered by the orchestrator
  • The Service Defaults project is used for shared dependencies that any Aspire-hosted apps can use
  • Service discovery allows for resolving addresses of Aspire-hosted apps via the names the apps were registered under in the orchestrator
  • Aspire orchestrator displays a dashboard, which shows the status of all running services

FAQ

What problem does Aspire solve for distributed applications?Aspire helps developers run, configure, debug, and observe multiple independently running services as one coordinated system during local development. It reduces the pain of starting each component separately, wiring dependencies manually, and tracking logs across many windows.
What is a distributed application?A distributed application is a collection of autonomous services that run in separate processes and communicate over the network, often through HTTP APIs or messaging. Each service handles a specific business capability and can be developed, deployed, and scaled independently.
How is a distributed system different from a monolithic application?In a distributed system, functionality is split across multiple services that communicate over a network. In a monolithic application, the business logic is contained in one executable, even if it is internally organized into modules. A modular monolith has separation inside the codebase, but it is still deployed as one unit.
What are the main advantages of distributed systems?Key advantages include independent deployment, easier scaling of individual services, greater team agility, technology flexibility, better fault isolation, and improved maintainability. These benefits make distributed systems attractive for growing applications with multiple teams or changing requirements.
What are the main disadvantages of distributed systems?Distributed systems add complexity, operational overhead, network-related failures, testing difficulty, potential performance costs, security concerns, and initial design effort. Because of this, they are not always the best choice for every application.
What is orchestration in the context of distributed systems?Orchestration is the coordination and management of services and resources in a distributed application. It includes starting, stopping, scaling, monitoring health, managing configuration, and allocating resources so the system works together correctly.
What is Aspire AppHost?AppHost is the Aspire project that acts as the orchestrator for the distributed application. In it, you declare the services and infrastructure resources, define their relationships, and let Aspire start them, connect them, and show their status in the dashboard.
What role do service defaults play in Aspire?Service defaults are shared extension methods used by Aspire-hosted apps to enable common capabilities such as service discovery, health checks, metrics, tracing, and HTTP client resilience. They centralize reusable setup so each app can participate in the Aspire environment consistently.
How does service discovery work in Aspire?Service discovery lets one service refer to another by name instead of hardcoding its address or port. Aspire resolves the correct network location at runtime, so services can move or change ports without requiring changes in the calling application.
What does the Aspire Starter Project contain in the online shop example?The starter solution includes OnlineShop.Web for the Blazor UI, OnlineShop.ApiService for the REST API, OnlineShop.AppHost as the orchestrator, and OnlineShop.ServiceDefaults for shared Aspire-related setup.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • How to Ship Distributed Systems with Confidence ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • How to Ship Distributed Systems with Confidence ebook for free