Posts

Showing posts from August, 2026

Clean Architecture in .NET: It's Not Just About Folder Structure

Image
  Clean Architecture in .NET: It's Not Just About Folder Structure One common misconception about Clean Architecture is that it simply means creating folders like: 📁 Domain 📁 Application 📁 Infrastructure 📁 API But Clean Architecture is much more than organizing files. The real objective is to protect business logic from technical dependencies. A typical .NET enterprise application can be structured around: 🔹 Domain Business entities, rules, and core business logic. 🔹 Application Use cases, interfaces, commands, queries, and application workflows. 🔹 Infrastructure Database, external APIs, messaging, storage, and other technical implementations. 🔹 API / Presentation HTTP endpoints, authentication, validation, and communication with clients. The key principle: Dependencies should point inward. Your business logic should not depend directly on: ❌ SQL Server ❌ Entity Framework ❌ Azure ❌ REST APIs ❌ Messaging infrastructure Instead, the core application defines abstractions, whil...

One Payment. Two Regions. Three Events. Designing an Idempotent Payment Architecture with Cosmos DB

Image
One Payment. Two Regions. Three Events. Designing an Idempotent Payment Architecture with Cosmos DB Radhakrishnan Perumal Award-Winning Principal Architect | .Net | Full Stack| GenAI |Azure| Guidewire | Driving Innovation with AI & Cloud | SMIEEE | Cybersecurity & TOGAF Expert | Author | PhD Scholar | Researcher | Anchor General Insurance August 11, 2026 A customer clicks Pay once. The payment provider processes $250 successfully . But inside our distributed system, something very different happens: Event #1 reaches Region A. Event #2 appears because the acknowledgement was lost. Event #3 is produced during a retry. Meanwhile, Region B is also active. Now ask the architectural question: How do we guarantee that one business payment produces one business outcome—even when the infrastructure delivers the event multiple times? This is where Event-Driven Architecture becomes more than simply: API → Service Bus → Consumer → Cosmos DB The Failure Scenario Imagine this flow: C...