redis 

Send to Kindle
home » snippets » redis



Tips and Tricks

Turn Redis async replication into synchronous replication

From: antirez

There are people that turn Redis async replication into synchronous replication with a trick: they perform:

MULTI
SET foo bar
PUBLISH foo:ack 1
EXEC

Because PUBLISH is propagated to the slave if they are listening with another connection to the right channel they'll get the ACK from the slave once the write reached the slave. Not always practical but it's an interesting trick.