How to Quickly Compare Data Consistency Between Two Redis Instances
This article explains what constitutes data inconsistency in Redis, outlines key and value mismatch scenarios, and introduces the open‑source redis‑full‑check tool with usage instructions for efficiently comparing two Redis instances across various deployment modes.
Recently revisiting Huang's "Redis Design and Implementation", I thought of several interview questions and summarized steps from real production.
Problem
How can we quickly compare two Redis instances to identify data inconsistencies?
What is Data Inconsistency
Key inconsistency
Same key name but different data types across instances
Key exists in source Redis but not in target Redis
Key exists in target Redis but not in source Redis
Value inconsistency
String‑type values differ between instances
For other types, compare the key similarly
Tool Recommendation
redis‑full‑check is an open‑source tool from Alibaba Cloud's Redis & MongoDB team that verifies whether two Redis datasets are consistent. It supports single‑node, master‑slave, cluster, and various proxies, works for both homogeneous and heterogeneous comparisons, and supports Redis versions 2.x‑5.x.
Download Tool
RedisFullCheck
Currently only supports Linux environments; for other platforms, compile yourself using Golang.
Running Usage
Parameter description:
-t target -s sourceExample command:
./redis-full-check -t 127.0.0.1:6379 -s 172.16.1.1:6379View Results
# Three‑round comparison generates three db files
sqlite3 result.db.1
> .tables
FINAL_RESULT field_1 key_1
> select * from key_1;Project recommendation: Spring Cloud, Spring Security OAuth2 RBAC permission management system – follow for updates. Free time now, more fancy series coming – stay tuned.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Architecture Diary
Committed to sharing original, high‑quality technical articles; no fluff or promotional content.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
