Module 1 · Foundations and the Request Path · Lesson 2 of 9
What to optimize first
Before diving into individual topics, it helps to anchor decisions around a few stable questions:
Questions to anchor decisions
| Question | Why it matters | Typical .NET starting point | When to upgrade the design |
|---|---|---|---|
| Is the bottleneck CPU, latency, network, or database contention? | Load balancing, CDN, caching, and indexing solve very different problems. | ASP.NET Core API + SQL Server/Azure SQL + IMemoryCache or IDistributedCache. | When p95 latency, DB CPU, or queue depth stops improving with vertical scaling. |
| Is the operation read-heavy, write-heavy, or coordination-heavy? | Read-heavy systems benefit from cache and replicas; write-heavy systems often need partitioning and queue smoothing; coordination-heavy systems need explicit workflow patterns. | EF Core for transactional writes, Dapper for tuned reads, optional CQRS read model. | When read amplification, transactional hotspots, or long-running business workflows appear. |
| Can you tolerate stale data? | Consistency choice directly affects latency, throughput, and UX. | Strong consistency in a single SQL database. | Move to session or eventual consistency when global distribution or independent service ownership matters more than immediate read freshness. |
| What happens when the same request or message is processed twice? | Retries without idempotency create duplicate side effects; queues and distributed workflows make duplicates normal, not exceptional. | Use DB uniqueness, optimistic concurrency, and idempotency keys for critical commands. | Add outbox/inbox and deduplication once you introduce asynchronous messaging. |
Request path building blocks
Load balancers
Definition. A load balancer distributes incoming traffic across multiple compute resources to optimize utilization, maximize throughput, minimize response time, and prevent overload on any single node. Azure distinguishes global versus regional load balancing and Layer 7 HTTP(S) versus Layer 4 TCP/UDP approaches; for example, Azure Front Door is a global Layer 7 application delivery network, Application
Sign in to mark lessons done and keep your place in the course.Sign in