redis - How to maintain strong consistency in distributed computing? -


for example have master(m) , slave1(s1) , slave2(s2). if synchronous replication below,

  1. update master, , lock write
  2. replicate slave1 , slave2
  3. unlock write of master.

but above not strong consistency.

  • scenario 1, when both replicates s1 , s2 successful,

the users reading slave1 or slave2 can different values @ moment.

  • scenario 2, replicate s1 successful, replicate s2 fails.

in case, master should cancel write s1. users may read it.


so it's hard maintain strong consistency. therefore, algorithms companies use maintain strong consistency if it's necessary? how make eventual write value visible clients @ exact same time? thanks.

putting things in simplest form;

there 2 ways provide consistency

  • first take lock before writing database or caching system. ensures read , write lock. includes master server well.

    to further enhance locking mechanism, distribution of keys maintained such reads re-directed towards consistent server(s) (if new servers being added @ time).

    at time of lock, operations can buffered (with timeouts) when new value applied. returned.

  • secondly, if replication fails there added complex layer of rollovers. ensures data consistent if not not applied.

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -