Eventual consistency vs. strong consistency: Making the right choice in microservices

Ashwin Chavan *

Software Architect and Technical Product Owner, Pitney Bowes, Austin TX.
 
Review
International Journal of Science and Research Archive, 2021, 01(02), 071-096.
Article DOI: 10.30574/ijsra.2021.1.2.0036
Publication history: 
Received on 12 December 2020; revised on 20 January 2021; accepted on 24 January 2021
 
Abstract: 
This paper discusses one of the most crucial decisions for microservices, which is between eventual consistency and strong consistency. It examines how every model influences the system's efficiency, stability, and usability. Eventual consistency is also good for availability and scalability because it uses asynchronous updates, which is recommended for social sites like Facebook and e-commerce sites like Amazon. However, it brings issues like transient data instabilities and conflicts in managerial schemes. On the other hand, strong consistency guarantees real-time data updates, ideal for companies dealing with critical areas such as finance and healthcare since data must meet set regulatory standards. Still, it causes high latencies and additional expenditures on the infrastructure. In theoretical approaches, namely the CAP and PACELC theorems, this paper explains various aspects of the tradeoffs between consistency, availability, and performance. Analyzing the real-world use cases, including Saga and Outbox patterns, the most important approaches to achieve consistency with the needed freedom in system design can be outlined. In such a context, hybrid models appear as potential strategies that define consistency levels according to data and related operations' sensitivity. Anticipated future work, another trend in algorithmic adaptability and dynamic self-synchronization, contemplates new strategies for the persistence of consistency at the distributed application level. Matching consistency choices with business needs allows organizations to improve system performance, costs, and credibility. This article calls for more comprehensive and long-growth learning, effective testing, and iterative architectural planning while dealing with the intricacies of consistency models in the dynamic setting of microservices architecture, providing artists and developers with a thorough guide in the process.
 
Keywords: 
Eventual Consistency; Strong Consistency; Microservices Architecture; Distributed Systems; CAP Theorem; Consistency Models; Domain-Driven Design (DDD); Event-Driven Architecture
 
Full text article in PDF: