I’m going to start this article by explaining what Eventual Consistency is, how it compares to Transactional Consistency, and when we should consider designing a solution with this approach. Next we’re going to look at Domain Events, see what their role is in relation to eventual consistency and also how we can identify them in the domain language. Finally, based on a simple scenario, we’ll go through the implementation details of a proposed architecture, using Azure Service Bus messaging system.
Transactional vs Eventual
As the name implies it, eventual consistency is about being consistent, well, eventually. In this context eventually means at a later time. It’s easier to understand this concept when comparing it to transactional consistency, as in the following diagrams: