C# Async/Await Architecture for I/O-Bound Server Work
A practical architecture note for C# async/await in server applications, covering design boundaries, verification, and failure modes.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
A practical architecture note for C# async/await in server applications, covering design boundaries, verification, and failure modes.
Use IHttpClientFactory to pool HttpMessageHandler instances, avoid socket exhaustion, and respect DNS changes. Register named or typed clients in Program.cs, inject the factory or typed interface, and tune handler lifetime for your deployment environment.
Learn how ASP.NET Core’s Output Cache middleware can store entire HTTP responses, cut database calls, and reduce latency on expensive endpoints. Start with a short duration and scale as needed.
Choose the right Blazor render mode per component: Static, InteractiveServer, InteractiveWebAssembly, or Auto.
Replace ad-hoc threads with IHostedService and BackgroundService to run reliable background tasks that respect shutdown, handle scoped dependencies, and avoid crashing your .NET Core application.
A practical guide to Transient, Scoped, and Singleton lifetimes in .NET's built-in DI container, with a runnable example showing how to observe instance identity across requests and why captive dependencies slip through in Production.
Architecture note on the Blazor Server circuit model: managing per-circuit state isolation, SignalR trust boundaries, operational checks, and the limits of in-memory state.
Implement a minimal, secure health‑check endpoint in ASP.NET Core microservices. Learn the smallest architecture, protect the endpoint, differentiate liveness and readiness, and know when to redesign.
Minimal APIs in .NET 6 let you write lightweight microservices without controllers, cutting boilerplate by ~70%. This guide walks through a practical example, explains key trade‑offs, and shows how to verify startup and memory gains.