Distributed Systems
Where senior interviews really start. Theory and practice of messaging, broker selection, resilience, caching, idempotency, locks, topology, and scheduled jobs (Quartz/Hangfire).
The sidebar under this section is grouped into Distributed Fundamentals (CAP/PACELC, messaging fundamentals, idempotency keys, distributed locks — the theory before the deep specs), Messaging Patterns (outbox/inbox, sagas + compensation, workflow engines, backpressure, CQRS read-model rebuilding), Brokers & Transport (broker comparison, Kafka deep, MassTransit/Wolverine), Resilience & Caching (Polly v8, IHttpClientFactory, caching strategies), Topology & Routing (YARP, load balancing, service discovery, multi-region), and Background Work (Quartz/Hangfire scheduled jobs).
Topics (canonical order)
-
At-least-once vs exactly-once, idempotency, ordering, partitioning, dead-letter
-
Solving the dual-write problem, transactional outbox, relay implementations
-
Sagas — Orchestration vs Choreography
When to use each, compensation, debugging long-running flows
-
Durable Functions, Temporal.io, DTFx — when workflow engines beat hand-rolled sagas
-
Service Bus vs RabbitMQ vs Kafka vs Event Hubs — when to choose which
-
The .NET messaging framework choices, conventions, sagas-as-code
-
ResiliencePipeline,Microsoft.Extensions.Resilience, retry/circuit-breaker/hedging/timeout/bulkhead -
SocketsHttpHandlerinternals,PooledConnectionLifetime, DNS refresh, named/typed clients -
IDistributedCache,HybridCache(.NET 9), cache-aside, stampede protection, invalidation -
YARP basics, BFF pattern, gateway concerns, transforms
-
RR / least-conn / consistent-hash, L4 vs L7, health probes, sticky sessions, .NET hosting context
-
DNS / Consul / etcd / K8s Services / Aspire ServiceDiscovery — client-side vs server-side
-
Stripe-style header pattern, server-side dedup window, response caching, concurrency
-
Bounded channels, prefetch limits, push vs pull, TPL Dataflow, anti-patterns
-
Semantic vs technical rollback, pivot points, idempotent comps, MassTransit state machines
-
Active-active vs active-passive, conflict resolution, CRDTs, Cosmos consistency levels
-
Consumer groups, exactly-once, KRaft, Schema Registry, partition assignment, perf levers
-
Replay strategies, snapshotting, versioned projections, catch-up subscriptions
-
Postgres advisory / SQL Server applock / Redis SETNX / RedLock critique / fencing tokens, Azure Blob lease
-
The "P is forced" framing, PACELC's L-vs-C trade, consistency lattice, .NET-relevant store mappings
Why this order
Fundamentals → outbox/sagas → workflow engines → brokers → MassTransit/Wolverine builds messaging knowledge from concept to concrete tooling. Resilience + HttpClient + caching come next because every distributed system depends on them. YARP closes the section as the gateway-and-proxy capstone.
Cross-references
- Outbox heavily depends on EF Core — Concurrency & Transactions.
- Sagas reference DDD Tactical Patterns.
- Resilience and HttpClient feed forward into Distributed Tracing — every retry should be a span.
- Caching links to Performance.