GET request

33 views
Skip to first unread message

ashleylyn...@gmail.com

unread,
Jun 17, 2015, 11:28:29 AM6/17/15
to redi...@googlegroups.com
Hi,

Does anyone know how reads/writes are performed on a distributed Redis.

1) Since it is a Master-Slave configuration (where slaves by default are read only), do read requests go straight to the master? Or can a client directly access a slave node for a read request?

2) Similarly for writes, will the client only to be able to write to the master? (in the case where slaves are read-only, I think this must be yes)..But if the slaves can accept writes, will the client have to request directly from the master, and the master will direct the client to the appropriate node, or can the client directly access a slave?

Thanks in advance!

Jan-Erik Rediger

unread,
Jun 17, 2015, 12:20:41 PM6/17/15
to redi...@googlegroups.com
Replies inline.

On Wed, Jun 17, 2015 at 08:28:28AM -0700, ashleylyn...@gmail.com wrote:
> Hi,
>
> Does anyone know how reads/writes are performed on a distributed Redis.
>
> 1) Since it is a Master-Slave configuration (where slaves by default are
> read only), do read requests go straight to the master? Or can a client
> directly access a slave node for a read request?

A normal Master-Slave configuration doesn't handle this. It's up to your
application to contact the right node. There are clients and proxies out
there that can handle this for you though.

>
> 2) Similarly for writes, will the client only to be able to write to the
> master? (in the case where slaves are read-only, I think this must be
> yes)..But if the slaves can accept writes, will the client have to request
> directly from the master, and the master will direct the client to the
> appropriate node, or can the client directly access a slave?

Yes, only the Master is writable. Even if you allow writes on the slave
these are not synced back to the Master.
The Master won't even direct any client anywhere nor will the Slave.

You could take a look at Sentinel[1], which is used for monitoring and
handling automatic failover of such a setup. Your clients can then ask a
Sentinel for the address of the Master or one of its slave.

[1]: http://redis.io/topics/sentinel

-- Jan-Erik

ashleylyn...@gmail.com

unread,
Jun 18, 2015, 1:00:54 PM6/18/15
to redi...@googlegroups.com, jan...@fnordig.de
Thank you Jan-Erik!
Reply all
Reply to author
Forward
0 new messages