Awesome
RedisShake 4.x: Redis Data Processing & Migration Tool
Overview
RedisShake is a tool designed for processing and migrating Redis data. It offers the following features:
-
Redis Compatibility: RedisShake is compatible with Redis versions ranging from 2.8 to 7.2, and supports various deployment methods including standalone, master-slave, sentinel, and cluster.
-
Cloud Service Compatibility: RedisShake works seamlessly with popular Redis-like databases provided by leading cloud service providers, including but not limited to:
-
Module Compatibility: RedisShake is compatible with TairString, TairZSet, and TairHash modules.
-
Multiple Export Modes: RedisShake supports PSync, RDB, and Scan export modes.
-
Data Processing: RedisShake enables data filtering and transformation through custom scripts.
Getting Started
Installation
Download the Binary Package
Download the binary package directly from the Releases page.
Docker
docker run --network host \
-e SYNC=true \
-e SHAKE_SRC_ADDRESS=127.0.0.1:6379 \
-e SHAKE_DST_ADDRESS=127.0.0.1:6380 \
ghcr.io/tair-opensource/redisshake:latest
Compile from Source
To compile from source, ensure that you have a Golang environment set up on your local machine:
git clone https://github.com/tair-opensource/RedisShake
cd RedisShake
sh build.sh
Usage
To migrate data from one Redis instance to another while skipping keys with specific prefixes, follow these steps:
- Ensure you have two Redis instances running:
- Instance A: 127.0.0.1:6379
- Instance B: 127.0.0.1:6380
- Create a new configuration file
shake.toml
, and set theblock_key_prefix
parameter to skip keys with specific prefixes:
[sync_reader]
address = "127.0.0.1:6379"
[redis_writer]
address = "127.0.0.1:6380"
[filter]
block_key_prefix = ["temp:", "cache:"]
- Start RedisShake by running the following command:
./redis-shake shake.toml
For more detailed information, please refer to the documentation:
Contributing
We welcome contributions from the community. For significant changes, please open an issue first to discuss what you would like to change. We are particularly interested in:
- Adding support for more modules
- Enhancing support for Readers and Writers
- Sharing your Lua scripts and best practices
- Improving the documentation
History
RedisShake is a project actively maintained by the Tair team at Alibaba Cloud. Its evolution can be traced back to its initial version, which was forked from redis-port.
During its evolution:
- The RedisShake 2.x version brought a series of improvements and updates, enhancing its overall stability and performance.
- The RedisShake 3.x version represented a significant milestone where the entire codebase was completely rewritten and optimized, leading to better efficiency and usability.
- The current version, RedisShake 4.x, has further enhanced features related to readers, configuration, observability, and functions.
License
RedisShake is open-sourced under the MIT license.