WAIT: synchronous replication for Redis
antirez.com
antirez.com
Example:
1 - client 1 set foo,bar to node 1
2 - node 2 replicates the data
3 - client 2 set foo,baz to node 1
4 - node 2 replicates the data
What if a read (get foo) reaches node 2 between step 3 and 4? What's the return value? "bar" or "baz"?
It would be nice if this kind of consistency can be done with redis... however... great work!!
What it is possible to do however at least in the context of Redis Cluster is to query for "CLUSTER NODES" and get the minimum number of slaves connected for a given master, and use that to auto-configure the client.
For stand alone Redis instances there is no way to obtain the max number of attached slaves, only the current number unfortunately.
EDIT: another possibility is that the master itself is configured with a default value that is used when the client sends, for example, -1 as number of requested replicas.