redis-diff

command module
v0.0.0-...-29a079f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2016 License: MIT Imports: 10 Imported by: 0

README

redis-diff

Diff Redis Instances for key and value matching. Uses incremental REDIS SCAN with cursor to limit the load impact on REDIS.

Installation

mkdir -p ~/tmp/redis-diff
cd !$
GOPATH=$(pwd) go get github.com/zph/redis-diff
cp bin/redis-diff ~/bin/ # [or somewhere else on your path]

Usage

$ ./bin/redis-diff
Usage of ./bin/redis-diff:
  -delimiter string
      Delimiter that will be used to separate output (default "|")
  -dst string
      redis://:password@host:port?db=0 (default "redis://localhost:6379")
  -keys *
      Match subset of keys * (default "*")
  -parallel 20
      Threading count. Default 20 (default 20)
  -src string
      Format redis://:password@host:port?db=0

Sample Output on STDOUT

key1|valuedb1|valuedb2
key4|valuedb1|valuedb2
key6|valuedb1|valuedb2

Performance

Iterates through src keyspace at ~500 to 1000 keys per second on my development machine when pointed at hosted redis instance on separate machine. I suspect the bottleneck is the key scanner itself, but I didn't see ways to improve that performance.

License

  • MIT

Prior Art

Contributions

  • Contributions are welcome
  • Fork it and submit PRs

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL