Module 1 · Orientation and Load Balancing · Lesson 2 of 18
Quick cheat sheet
Topic
| Topic | Solves | .NET / C# hook | Main trap |
|---|---|---|---|
| Load balancers | Spread traffic, fail over, enable deploys | Map health/readiness endpoints; handle forwarded headers | Bad health checks and sticky state |
| Caching | Reduce latency and DB/API load | IMemoryCache, IDistributedCache, cache-aside | Stale data, stampedes, data leaks |
| SQL vs NoSQL | Choose persistence model | EF Core for SQL; abstractions for document/key stores | Picking by hype instead of access pattern |
| Indexing | Speed selective reads and sorting | HasIndex, unique indexes, query-plan review | Over-indexing and wrong composite order |
| Sharding | Scale writes/storage beyond one DB | Tenant-aware DbContext factory/shard resolver | Cross-shard queries and rebalancing |
| Replication | Read scale, HA, DR | Primary for writes, replicas for stale-ok reads | Replica lag and failover ambiguity |
| Message queues | Async work and spike smoothing | Outbox table + BackgroundService publisher | Duplicate messages and poison retries |
| Rate limiting | Protect shared capacity | AddRateLimiter partitioned by tenant/user/key | Wrong identity and retry storms |
| CDN | Edge cache and origin protection | Cache-Control, ETag, static asset versioning | Caching private data |
| Consistency | Define read/write guarantees | EF transactions, rowversion, optimistic concurrency | Mixing caches/replicas without rules |
| Eventual consistency | Scale cross-service workflows | Versioned events, projectors, reconciliation | Promising immediate consistency |
| Idempotency | Make retries safe | Idempotency-Key table; processed message IDs | In-memory key stores and body mismatch |
| Observability | Understand production behavior | ILogger, ActivitySource, Meter, health checks | PII leakage and high-cardinality metrics |
| AuthN/AuthZ | Identity and permissions | JWT bearer, policies, resource checks | Trusting client tenant/user claims |
| API design | Stable contracts | Minimal APIs, ProblemDetails, OpenAPI metadata | Leaking entities and weak pagination |
| Multi-tenant | Serve many customers safely | Tenant context, query filters, per-tenant quotas | Isolation leaks and noisy neighbors |
| Background jobs | Run slow/scheduled work | BackgroundService, Channel, durable queue | Lost in-memory jobs |
| Distributed locks | Coordinate rare shared work | Lease table, TTL, fencing token | Using locks instead of constraints |
| Failure handling | Limit blast radius | CancellationToken, retries with jitter, DLQ | Retrying non-idempotent work |
| Cost trade-offs | Keep system economically sane | Sampling, batching, caching, capacity metrics | Complexity before evidence |
Sign in to mark lessons done and keep your place in the course.Sign in