// essays

Blog

Architecture, code design and AI inside business systems, written from production work. Short, opinionated, with code you can run.

Oct 23, 2026 Concurrency and Locking in .NET · Part 2

The Optimistic Concurrency EF Core Gives You for One Column

Part 2 of the locking series: the optimistic concurrency EF Core gives you for a rowversion column, measured under 50 concurrent transfers. How the token becomes a WHERE predicate, how to handle DbUpdateConcurrencyException without a stale change tracker, which retry policy does not stampede, and where a hot row breaks it.

EF Core rowversion concurrency token DbUpdateConcurrencyException Read the essay
Oct 19, 2026

Multi-Tenancy Is an Identity Problem

Silo, pooled compute with siloed data, or one partitioned database: the layout sets the isolation boundaries. The leak is always the same mistake, a request that reached the data layer without knowing its tenant. Put the tenant id in the token, resolve it once at the edge, let the data layer apply it to reads and writes, and hand it explicitly to workers and jobs.

SaaS multi-tenancy multi-tenant architecture tenant isolation Read the essay
Oct 2, 2026

Software Architecture Is All About Trade-Offs

There is no best architecture. Every decision gives you something and takes something away. The price starts on day one, the benefit only when the need shows up. Why moving code to another server does not fix coupling.

software architecture trade-offs microservices monolith Read the essay
Sep 28, 2026

Creating an AI Agent in .NET with Microsoft Agent Framework

A customer support agent built with the Microsoft Agent Framework inside a clean architecture solution: the abstraction in Application, Ollama and the C# tools in Infrastructure, a domain that never hears about AI, and a model that can only ask for the methods you chose to expose.

Microsoft Agent Framework AI agent Ollama tools Read the essay
Sep 26, 2026

What an AI Harness Is

A model turns text into text and nothing else. The harness is the loop, the tools, the context and the guardrails around it, and it is the part that decides whether an AI tool works. Agent harness, eval harness, and why you should compare harnesses instead of models.

AI harness agent harness eval harness LLM Read the essay
Sep 25, 2026

Start With a Loosely Coupled Monolith

Greenfield project, small team, no microservices on day one. Bounded contexts as separate projects, one schema per module, messages between modules, and why the split to services later is a deployment decision and not a rewrite.

monolith modular monolith microservices bounded context Read the essay
Aug 7, 2026 Concurrency and Locking in .NET

Concurrency and Locking in .NET: The Series

A five-part series on race conditions in .NET and how to fix them at the right layer: in-process locks, database locks, optimistic concurrency and distributed locks.

concurrency locking race condition SemaphoreSlim Read the essay