Architecture
12 posts tagged “Architecture”.
September 2026
-
CQRS without the ceremony
CQRS often arrives with separate databases, event sourcing and a mediator library. The core idea is much simpler and useful on its own: write through your domain model, read with plain queries.
August 2026
-
Where does validation belong?
Request validation, business rules and data constraints are different kinds of checks. Putting each one in the right layer avoids both duplication and gaps.
-
Changing a message without breaking its consumers
Once other services consume your messages, the message format is a public contract. Additive changes are easy; breaking ones need a plan. Here's how to evolve message contracts safely.
July 2026
-
Replace legacy systems one route at a time
Big-bang rewrites of legacy apps tend to run late and launch with surprises. The strangler fig pattern moves functionality to the new system piece by piece, with a working system at every step.
June 2026
-
Keep other systems' models out of yours
When a third-party API's field names and status codes spread through your code, every change on their side becomes a change on yours. An anti-corruption layer stops it at the boundary.
-
Domain events and integration events aren't the same thing
Both describe something that happened, but one stays inside your service and the other is a public contract. Mixing them up couples services you meant to keep apart.
April 2026
-
Organize code by feature, not by layer
Controllers, Services, Repositories: a layered folder structure spreads one feature across five places. Vertical slices keep everything for a feature together.
March 2026
-
Exceptions or results for expected failures?
"Customer not found" isn't exceptional, but most .NET code throws for it anyway. A simple result type makes expected failures part of the method's signature.
January 2026
-
Value objects with C# records
Replacing a
decimaland astringwith aMoneytype removes a whole class of bugs. Records make value objects short to write, with one catch aroundwithexpressions.
December 2025
-
Write down your architecture decisions
Six months from now, nobody will remember why you chose Service Bus over Event Grid. An architecture decision record takes ten minutes to write and answers that question for good.
November 2025
-
Start with a modular monolith
Microservices solve problems most new systems don't have yet. A modular monolith gives you clean boundaries now and an easy path to split later, if you ever need to.
-
The transactional outbox pattern
Saving to the database and publishing a message are two separate operations, and one of them will eventually fail. The outbox pattern makes them succeed or fail together.