iTranslated by AI
Is Data Consistency Guaranteed Across Services?
Is data consistency between services guaranteed?
Background/Overview
In microservices or loosely coupled systems, ensuring consistency becomes difficult, so it is necessary to clarify "when consistency should be achieved" during the design phase.
Examples
- Adopt a consistency strategy based on event-driven architecture + eventual consistency.
- Instead of synchronizing a status update bidirectionally between the Task service and the Document service, ensure consistency through a unidirectional data flow, such as having only the Task service perform the update and the Document service only subscribe to it.
- Prevent inconsistencies by sending events after updates and validating them on the receiving end.
Common Failure Examples
- Data becomes inconsistent due to bidirectional updates, making it unclear which information is the latest.
- Processing order is not guaranteed, leading to data being overwritten by older events.
- Read discrepancies occur due to replica lag.
FAQ
Q. Is eventual consistency really okay?
A. It depends on the case, but for many business operations, "consistency within a certain timeframe" is often sufficient rather than immediate consistency. It is important to consider this, define it, and document it clearly.
Q. Should bidirectional synchronization be avoided?
A. As a general rule, yes. You should avoid it because it leads to "synchronization hell" unless you adopt a unidirectional update flow.
Related Perspectives
- Is the necessity of distributed transactions for ensuring consistency well-organized?
- Is the design built to consider the impact of asynchronous event delays and retry processing?
- Has the impact of failures in dependent external services been considered?
- Is the scope of application for asynchronous and synchronous processing appropriate?
📘 This article is part of the SaaS Design Review Perspective Checklist (2025 Edition).
0 Design perspective category: 🔁 Events / Asynchronous Processing
0 Level: Structure (Structure, Principles, Responsibility Organization Level)
0 Recommended readers: Design beginners / Teams in the design phase / Reviewers
🧭 Click here to read other perspectives as well.
Discussion