GithubHelp home page GithubHelp logo

rump's Introduction

Hot sync two Redis databases using dumps.

Why

There's no easy way to get/sync data from an AWS ElastiCache Redis cluster.

@bdq: Hey, let's keep our staging Redis containers in sync with our AWS ElastiCache. BGSAVE and copy the .rdb?

@nixtrace: Yeah, awesome, let me try... Nope, not supported.

@bdq: Ah, that's bad. We'll have to set the containers as SLAVEOF?

@nixtrace: That makes sense, doing it... Nope, not supported.

@bdq: WAT. Let's use an open source tool to do the sync?

@nixtrace: Most of them use KEYS to get the keys, we'd DoS our own server.

@bdq: Let's write a script?

@nixtrace: Tried. Bash doesn't like key dumps, Ruby/Python + deps take more space than Redis inside the container.

@bdq and @nixtrace: Let's write it in Go?

Rump is able to transfer keys from an ElastiCache cluster or any Redis server to another Redis server, by only using SCAN, DUMP and RESTORE.

Features

  • Uses SCAN instead of KEYS to avoid DoS your own server.
  • Can sync any key type.
  • Drops the TTL on purpose, since it wouldn't be in sync.
  • Doesn't use any temp file.
  • Uses buffered channels to optimize slow source servers.
  • Uses pipelines to minimize network roundtrips.

Examples

# Sync local Redis DB 1 to DB 2.
$ rump -from redis://127.0.0.1:6379/1 -to redis://127.0.0.1:6379/2

# Sync ElastiCache cluster to local.
$ rump -from redis://production.cache.amazonaws.com:6379/1 -to redis://127.0.0.1:6379/1

# Sync protected ElastiCache via EC2 port forwarding.
$ ssh -L 6969:production.cache.amazonaws.com:6379 -N [email protected] &
$ rump -from redis://127.0.0.1:6969/1 -to redis://127.0.0.1:6379/1

Demo

asciicast

Contribute

  • We use GitHub issues to discuss everything: features, bugs, docs.
  • Before sending a pull request always open an issue.

Install

You can find pre-compiled binaries on the releases page. If you don't see your OS/Arch there, just ask :)

Mentions

Maintainers

nixtrace

License

Rump is licensed under the MIT License

rump's People

Contributors

nixtrace avatar badshark avatar jdorfman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.