Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Data Ownership and Database per Service: Why Avoid a Shared Database?
A shared database creates coupling that appears in no contract; each service's data should be private to it, and others should reach it through API composition, a local copy replicated through events, or a CQRS read model. Enforcing the boundary with schema-level permissions in SQL Server, a version-checked copy driven by BookRenamed, the snapshot difference, reference data and CDC for reporting.
No Transactions Across Microservices: Embracing Eventual Consistency by Design
Distributed transactions (2PC) are not used across services; a rule that needs immediate consistency stays in one service, and a flow spanning several services is built with sagas and compensating actions, with events going through an outbox. The real error TransactionScope gives on Linux and macOS, a choreographed checkout saga, intermediate states in the domain, and eventual consistency shown to the user with 202 Accepted.