|
Answer» Consistency from the CAP theorem states that every read request should get the most recently written data. When there are multiple data copies available, there arises a problem of synchronizing them so that the CLIENTS get fresh data consistently. Following are the consistency patterns available: - Weak consistency: After a data write, the read request may or may not be able to get the new data. This type of consistency works well in real-time use cases like VoIP, video chat, real-time multiplayer games etc. For example, when we are on a PHONE call, if we lose network for a few seconds, then we lose information about what was spoken during that time.
- Eventual consistency: Post data write, the READS will eventually see the latest data within milliseconds. Here, the data is replicated asynchronously. These are seen in DNS and email systems. This works well in highly available systems.
- Strong consistency: After a data write, the subsequent reads will see the latest data. Here, the data is replicated SYNCHRONOUSLY. This is seen in RDBMS and file systems and are suitable in systems requiring transactions of data.
|