Topic
Architecture & Design
Patterns and design choices for .NET systems that need clear boundaries, reliable messaging, and room to change.
Practice this topic: C# architecture exercises →
Try Two Sides of the Hexagon → Free, no account needed
Latest articles
RSS feed →18 articles
No articles match. Try fewer words or a different term. Search all articles
Strangler fig pattern for replacing legacy behind a seam
The strangler fig pattern replaces legacy code route by route. A shadow run found 31 mismatches in 1,000 generated policies before any caller saw one.
Read article →Domain events vs integration events: where each belongs
Domain events vs integration events: one is a private fact inside a transaction, the other a public contract, and a one-field rename shows why they differ.
Read article →Result pattern in C#: when it beats exceptions
The result pattern in C# puts expected failure in the signature. A returned rejection ran about 160 times faster than a throw, which is rarely the best reason.
Read article →CQRS pattern from one database up, and what each step costs
The CQRS pattern can start in one database: a demo queue page went from 2,000 hydrated comment rows to 50 integers before any second store existed.
Read article →Modular monolith: what makes a module boundary real
A modular monolith holds only when crossing a boundary fails a build or a query. Three checks separate real modules from folders with good names.
Read article →API Backward Compatibility During a Rolling Deployment
Preserve API backward compatibility while old clients and servers coexist. Design additive contracts, safe defaults, and tests for staged HTTP rollouts.
Read article →Distributed tracing in .NET with OpenTelemetry
Timeout in service C, silence in A and B: context never propagated. How traceparent, ActivitySource, and OpenTelemetry turn three logs into one trace.
Read article →Saga pattern in .NET: compensating transactions, not 2PC
Split checkout across services and rollback stops existing. Build a .NET saga: persisted orchestrator steps, compensations, a pivot, and idempotent retries.
Read article →Aspire Service Discovery: Names, Ports, Replicas
Learn how Aspire service discovery turns logical names into endpoints with WithReference, HttpClient resolution, health checks, and replica load balancing.
Read article →Circuit Breaker Pattern in .NET with Polly
Build a circuit breaker in modern .NET with Polly and HttpClient resilience. Tune the failure window, compose retries safely, and prove recovery.
Read article →Message Queue vs Event Bus: Choose the Topology
Compare message queues, event buses, and pub/sub by delivery topology. Choose competing workers or fan-out, then design retries and ordering honestly.
Read article →Structured Logging in .NET: Write Logs You Can Query
Learn structured logging in .NET with ILogger message templates, named fields, scopes, correlation IDs, safe data handling, and query-first design.
Read article →Transactional outbox pattern in .NET: publish without losing messages
Saving data and publishing an event are two writes that can disagree. Build a transactional outbox with EF Core, a retrying publisher, and idempotent consumers.
Read article →AddSingleton vs AddScoped vs AddTransient: what each promises
AddSingleton vs AddScoped vs AddTransient in plain terms: what each lifetime promises, sensible defaults, and the captive dependency bug that ships.
Read article →Caching strategies: cache-aside, invalidation, and stampedes
Caching strategies from the cache-aside flow to the hard parts: invalidation owned by a human and stampedes tamed by single-flight and jitter.
Read article →Architecture fitness functions: tests that fail the build when your layers rot
Architecture decays because nothing fails the build when the domain references the DbContext. ArchUnitNET fitness functions assert layering rules in CI.
Read article →Hexagonal architecture in .NET without the dogma
Ports and adapters in plain C#: domain in the center, ports as interfaces, adapters as infrastructure. Why it beats layered spaghetti, and when it is overkill.
Read article →Dependency inversion in C# is not about your DI container
The D in SOLID is the most quoted and least applied principle. Dependency inversion means owning your abstractions and pointing dependencies inward.
Read article →