|
|
|
|
|
by _Lemon_
5191 days ago
|
|
Redis can only perform asynchronous replication because it uses a single thread. It cannot block the main thread waiting for the network and have acceptable performance. This makes replication as good as "appendfsync no" as you have no guarantees as to what happened on the network write. The upside of the design is that it makes things simple (e.g., transactions, append only file). (This is my understanding, please correct me if I'm wrong!) |
|
However there are people that turn Redis async replication into synchronous replication with a trick: they perform:
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.