.NET Architecture & System Design Interview Question #100
How do you choose a consistency model for a distributed system?
Transactions, CQRS, Event Sourcing & Distributed Consistency Mid-Level Intermediate
Quick Interview Answer
Choose the consistency model from business invariants and user expectations rather than selecting strong or eventual consistency globally. Identify which operations must be immediately correct and which can tolerate temporary staleness.
Detailed Explanation
Choose the consistency model from business invariants and user expectations rather than selecting strong or eventual consistency globally. Identify which operations must be immediately correct and which can tolerate temporary staleness.
Keep strong transactional consistency inside boundaries where it is required. Use asynchronous propagation where independence, availability, or scale provides enough value to justify delayed consistency, and define reconciliation for failures.
Code Example
For each workflow ask:
Must this be correct immediately?
Yes -> transactional/strong boundary
Can it be temporarily stale?
Yes -> async/eventual propagation
Then define failure recovery.