redis / riot

🧨 Get data in & out of Redis with RIOT
http://redis.github.io/riot
Apache License 2.0
260 stars 38 forks source link

Live Replication from Replica #129

Open samongyr-sq opened 1 year ago

samongyr-sq commented 1 year ago

We want to use RIOT's live replication feature to migrate from self-hosted Redis to AWS Elasticache via a read-only replica to avoid performance issues caused by database load.

Our self-hosted Redis database uses standard asynchronous replication with a single writer and a replica. We do not use Redis Cluster.

graph LR;
    subgraph self-hosted
    subgraph src
    src_ro[("src:ro")]
    src_rw[("src:rw")]
    src_rw -.redis-repl .-> src_ro
    end
    end

    subgraph aws
    subgraph dst
    dst_rw[(dst:rw)]
    end
    end

    src -. riot-repl .-> dst_rw

We were able to set up live replication from src:ro, the read-only replica, to dst:rw.

> riot <src:ro> replicate --mode live <dst:rw>

This seems to work well; after writes to src:ro are replicated from src:rw via standard Redis replication, RIOT replicates them to dst:rw.

However, it appears that you cannot restart Redis replication on the replica (src:ro) without RIOT (unexpectedly?) missing writes. Specifically, we observed that writes made to src:rw while replication was paused were not propagated to dst:rw even after Redis replication has replicated them to src:ro.

Could you please clarify whether this behavior is expected