Code comments explain *what*, but not *why* a particular architectural decision was made. **ADRs** are lightweight Markdown documents capturing context, options considered, and the decision chosen. ADR Template Key Takeaways Store ADRs in the repo (`docs/adr/`). ADRs are immutable. If a decision changes, write a new ADR superseding the old one.
Read more →Tag: Architecture
Azure Service Bus: Messaging Patterns
Service Bus is Azure’s fully managed enterprise message broker. It supports Queues (point-to-point) and Topics/Subscriptions (pub/sub). Choosing the right pattern prevents architectural headaches. Queues vs Topics Dead-Letter Queue Messages that fail processing N times go to a special DLQ for inspection and replay. Key Takeaways Use **Sessions** for ordered processing (FIFO for a specific session […]
Read more →Designing for Nullability in C#
With Nullable Reference Types (NRTs) enabled by default in .NET 6 templates, designing APIs that clearly communicate nullability is no longer optional—it’s expected. Enabling NRTs Guard Clauses Use the new .NET 6 helper to throw if null. Key Takeaways Use `string?` to explicitly mark nullable strings. Use `!` (null-forgiving operator) sparingly—only when you truly know […]
Read more →.NET 6: Minimal APIs Explained
Minimal APIs are the biggest shift in ASP.NET Core since version 1.0. They remove the MVC ceremony (Controllers, Actions, Filters) in favor of a fluent lambda-based syntax. The Code Is it just for tiny apps? No. Performance is technically better than MVC (fewer allocations, no Filter Pipeline overhead). However, organization becomes the challenge. You don’t […]
Read more →Dependency Injection in .NET: Service Lifetimes
Using the wrong DI lifetime is the #1 cause of concurrency bugs in ASP.NET Core. We revisit Singleton, Scoped, and Transient with a focus on thread safety. The Three Lifetimes Lifetime Created… Thread Safety Transient Every time requested Safe (Instance per usage) Scoped Once per HTTP Request Safe (Single thread per request) Singleton Once per […]
Read more →React Server Components: The Future of React?
Late 2020 brought a preview of “React Server Components” (RSC). This is a paradigm shift. Unlike Server-Side Rendering (SSR) which merely sends HTML, RSCs allow components to run exclusively on the server, never sending their code to the client bundle. Client vs Server Components The Zero-Bundle-Size Promise If a component uses a large library (like […]
Read more →