Strong Consistency Model

In a strongly consistent system, all the replicas are updated with the most recent value as soon as any one of the replicas responds to a write request. However, during the time interval that the data is being updated in the replicas, all read/write requests made to any of the replicas will be delayed. The replicas will only respond to the request once all the nodes receive the update. In other words, the client will get a response for their request once all the nodes of the system are consistent.

Though the system may not be highly available at all times and there may be some latency in the responses, the client connected to any node can be guaranteed that they are viewing the most recent data.

Since all write requests are also blocked until all nodes are consistent and carry the latest update, the system also ensures that no concurrent updates are made. An entity can only be updated again once the first update is processed and replicated to all the nodes.

In short, strong consistency or immediate consistency makes sure that all the server nodes return the same value for an entity at any specific time. For this to happen, the system locks all the replicas until all the replicas are updated.

No alt text provided for this image

So you see that at T2 Node 1 is updated from an old value ‘X’ to ‘Y’. Now during the next interval of time (which could be a few seconds, minutes or more), the replicas (Nodes 2 and 3) are busy updating each other to become consistent with the originating node (i.e. Node 1). During this time, the system will put all read/write requests on hold until T4when all the nodes are updated with the new value.

Though the reply to the client by the system may be delayed, all read requests made immediately after an update will see the updated value and not a stale version of it. If a read is made to any of the nodes at T2or T3, the reply will be delayed. The client will receive the reply at T4but will see the updated value of the entity, i.e. Y.

Use Cases For A Strongly Consistent System

There are several applications where latency is acceptable, but stale data will disrupt the integrity of the system.

  1. Billing and banking applications work on strong consistency models since a delay is acceptable but an incorrect response of the system is not.
  2. Messages being sent and received through a messaging application must be strongly consistent.
  3. MMO games, which involve hundreds or thousands of players interacting with each other and virtual game objects follow a strong consistency model.
  4. Bidding on online auctions requires a strongly consistent system. If the system is not strongly consistent, the integrity of the results will suffer.


要查看或添加评论,请登录

?? Saral Saxena ???????的更多文章

社区洞察

其他会员也浏览了