back to home

leonchen83 / redis-replicator

A tool that can parse, filter, split, and merge RDB files, as well as analyze memory usage offline. It can also sync data between two Redis instances and allows users to define their own sink services to migrate Redis data to custom destinations.

View on GitHub
995 stars
278 forks
6 issues
Java

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing leonchen83/redis-replicator in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/leonchen83/redis-replicator)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

Table of Contents (中文说明) ================= • 1. Redis-replicator • 1.1. Brief Introduction • 1.2. Chat with Author • 1.3. Contact the Author • 2. Installation • 2.1. Requirements • 2.2. Maven Dependency • 2.3. Install from Source Code • 2.4. Select a Version • 3. Simple Usage • 3.1. Basic Usage • 3.2. Backup Remote RDB Snapshot • 3.3. Backup Remote Commands • 3.4. Convert RDB to Dump Format • 3.5. RDB Check • 3.6. Scan and PSYNC • 3.7. Other Examples • 4. Advanced Topics • 4.1. Command Extension • 4.1.1. Write a Command • 4.1.2. Write a Command Parser • 4.1.3. Register the Parser • 4.1.4. Handle Command Event • 4.1.5. Putting It All Together • 4.2. Module Extension • 4.2.1. Compile Redis Test Modules • 4.2.2. Uncomment in redis.conf • 4.2.3. Write a Module Parser • 4.2.4. Write a Command Parser • 4.2.5. Register Parsers and Handle Events • 4.2.6. Putting It All Together • 4.3. Stream • 4.4. Write Your Own RDB Parser • 4.5. Redis URI • 5. Other Topics • 5.1. Built-in Command Parsers • 5.2. EOFException • 5.3. Trace Event Log • 5.4. SSL Connection • 5.5. Authentication • 5.6. Avoid Full Sync • 5.7. Lifecycle Events • 5.8. Handle Huge Key-Value Pairs • 5.9. Redis 6 Support • 5.9.1. SSL Support • 5.9.2. ACL Support • 5.10. Redis 7 Support • 5.10.1. Function • 5.11. Redis 7.4 Support • 5.11.1. TTL Hash • 6. Contributors • 7. Consulting • 8. References • 9. Supported By • 9.1. 宁文君 • 9.2. YourKit • 9.3. IntelliJ IDEA • 9.4. Redisson • Redis-replicator 1.1. Brief Introduction Redis Replicator is an implementation of the Redis Replication protocol written in Java. It can parse, filter, and broadcast RDB and AOF events in real-time. It can also synchronize Redis data to a local cache or a database. In this document, refers to writable commands (e.g., , ) and excludes readable commands (e.g., , ). Supports Redis 8.4.x and older versions. 1.2. Chat with Author 1.3. Contact the Author **chen.bao.yi@gmail.com** • Installation 2.1. Requirements • **Compile:** JDK 9+ • **Runtime:** JDK 8+ • **Maven:** 3.3.1+ • **Redis:** 2.6 - 8.4 2.2. Maven Dependency 2.3. Install from Source Code 2.4. Select a Version | **Redis Version** | **redis-replicator Version** | |-------------------|------------------------------| | [2.6, 8.4.x] | [3.11.0, ] | | [2.6, 8.2.x] | [3.10.0,3.10.0] | | [2.6, 8.0.x] | [3.9.0, 3.9.0] | | [2.6, 7.2.x] | [3.8.0, 3.8.1] | | [2.6, 7.0.x] | [3.6.4, 3.7.0] | | [2.6, 7.0.x-RC2] | [3.6.2, 3.6.3] | | [2.6, 7.0.0-RC1] | [3.6.0, 3.6.1] | | [2.6, 6.2.x] | [3.5.2, 3.5.5] | | [2.6, 6.2.0-RC1] | [3.5.0, 3.5.1] | | [2.6, 6.0.x] | [3.4.0, 3.4.4] | | [2.6, 5.0.x] | [2.6.1, 3.3.3] | | [2.6, 4.0.x] | [2.3.0, 2.5.0] | | [2.6, 4.0-RC3] | [2.1.0, 2.2.0] | | [2.6, 3.2.x] | [1.0.18] (not supported) | • Simple Usage 3.1. Basic Usage 3.2. Backup Remote RDB Snapshot See RdbBackupExample.java 3.3. Backup Remote Commands See CommandBackupExample.java 3.4. Convert RDB to Dump Format You can use to convert an RDB file to the Redis DUMP format. 3.5. RDB Check You can use to check the correctness of an RDB file. 3.6. Scan and PSYNC By default, redis-replicator uses the command, pretending to be a replica, to receive commands. An example is as follows: However, on some cloud services, the command is prohibited. In such cases, you can use the command instead: 3.7. Other Examples See examples • Advanced Topics 4.1. Command Extension 4.1.1. Write a Command 4.1.2. Write a Command Parser 4.1.3. Register the Parser 4.1.4. Handle Command Event 4.1.5. Putting It All Together See CommandExtensionExample.java 4.2. Module Extension 4.2.1. Compile Redis Test Modules 4.2.2. Uncomment in redis.conf 4.2.3. Write a Module Parser 4.2.4. Write a Command Parser 4.2.5. Register Parsers and Handle Events 4.2.6. Putting It All Together See ModuleExtensionExample.java 4.3. Stream Since Redis 5.0, a new data structure called has been added. Redis-replicator parses data as follows: 4.4. Write Your Own RDB Parser • Write a that extends . • Register your with the using the method. 4.5. Redis URI Before version 2.4.0, was constructed as follows: Since version 2.4.0, we have introduced the Redis URI concept to simplify the construction process: • Other Topics 5.1. Built-in Command Parsers | **Command** | **Command** | **Command** | **Command** | **Command** | **Command** | |--------------|----------------|--------------------|--------------|---------------|----------------------| | **PING** | **APPEND** | **SET** | **SETEX** | **MSET** | **DEL** | | **SADD** | **HMSET** | **HSET** | **LSET** | **EXPIRE** | **EXPIREAT** | | **GETSET** | **HSETNX** | **MSETNX** | **PSETEX** | **SETNX** | **SETRANGE** | | **HDEL** | **UNLINK** | **SREM** | **LPOP** | **LPUSH** | **LPUSHX** | | **LREM** | **RPOP** | **RPUSH** | **RPUSHX** | **ZREM** | **ZINTERSTORE** | | **INCR** | **DECR** | **INCRBY** | **PERSIST** | **SELECT** | **FLUSHALL** | | **FLUSHDB** | **HINCRBY** | **ZINCRBY** | **MOVE** | **SMOVE** | **BRPOPLPUSH** | | **PFCOUNT** | **PFMERGE** | **SDIFFSTORE** | **RENAMENX** | **PEXPIREAT** | **SINTERSTORE** | | **ZADD** | **BITFIELD** | **SUNIONSTORE** | **RESTORE** | **LINSERT** | **ZREMRANGEBYLEX** | | **GEOADD** | **PEXPIRE** | **ZUNIONSTORE** | **EVAL** | **SCRIPT** | **ZREMRANGEBYRANK** | | **PUBLISH** | **BITOP** | **SETBIT** | **SWAPDB** | **PFADD** | **ZREMRANGEBYSCORE** | | **RENAME** | **MULTI** | **EXEC** | **LTRIM** | **RPOPLPUSH** | **SORT** | | **EVALSHA** | **ZPOPMAX** | **ZPOPMIN** | **XACK** | **XADD** | **XCLAIM** | | **XDEL** | **XGROUP** | **XTRIM** | **XSETID** | **COPY** | **LMOVE** | | **BLMOVE** | **ZDIFFSTORE** | **GEOSEARCHSTORE** | **FUNCTION** | **SPUBLISH** | **HPERSIST** | | **HSETEX** | **HPEXPIREAT** | **XACKDEL** | **XDELEX** | **MSETEX** | | 5.2. EOFException When event consumption is too slow and the backlog of events exceeds the Redis backlog limit, Redis will actively disconnect from the slave. When Redis-replicator reconnects, it will perform a full synchronization. To a…