redis strong consistency

560 views
Skip to first unread message

Shushant Arora

unread,
Nov 25, 2017, 11:19:48 AM11/25/17
to Redis DB
Hi

Does redis support strong consistency ?

  1. Write in redis are through master node only but read can be from clients so can I say write is successful only when its written to all client.
  2. Also can I configure client poling time interval so that I can safely assume system is eventual consistent with max delay of x ms.

hva...@gmail.com

unread,
Nov 25, 2017, 12:39:25 PM11/25/17
to Redis DB
 You're using the word "client" where the Redis community uses the word "slave".

Good coverage of strong consistency can be found in the Redis documentation for the WAIT command:  https://redis.io/commands/wait
The notable part is in the section titled "Consistency and WAIT":

Note that WAIT does not make Redis a strongly consistent store

Since Redis slaves are always connected to the master, and replication data transfers are initiated by the master, there is no "polling interval" to configure.  There is additional information in the documentation page that describes Redis replication:  https://redis.io/topics/replication

There are network architectures that can prevent any software from meeting a "max delay of x ms" requirement.  A typical example is replicating between servers that are located 3,000 miles apart, such as the US West and East Coasts.  On good days the one-way propagation delay is 30-40 ms (60-80 ms round trip), but when a long-distance provider has an outage, the delays can go higher.  A software architect must account for these kinds of unavoidable delays in specifying the nodes of the cluster and the cluster's consistency requirements.

By the way, it's a very good practice to perform only writes on the master node(s) and perform reads on the slave nodes, but Redis does not require it.  Keys can be read from the master node too.

Itamar Haber

unread,
Nov 25, 2017, 12:51:01 PM11/25/17
to Redis DB
Also, note that as of v3 Redis provides the [`WAIT`](https://redis.io/commands/wait) command that can be used by the issuing client to ensure the replication level.

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.



--

Itamar Haber | Chief OSS Education Officer
Redis Labs ~/redis

Mobile: +972 (54) 567 9692
Twitter: @itamarhaber
Skype: itamar.haber

Reply all
Reply to author
Forward
0 new messages