No commit activity in last 3 years
No release in over 3 years
proxy that read from redis(or ssdb) write to both use for redis <=> ssdb migration on production
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
>= 0
~> 10.0
>= 0
>= 0
 Project Readme

Redis SSDB Proxy Build Status Coverage Status Code Climate Dependency Status Gem Version

The Redis SSDB Proxy that read from redis(or ssdb) write to both use for redis <=> ssdb migration on production

Installation

Add this line to your application's Gemfile:

gem 'redis-ssdb-proxy'

And then execute:

$ bundle

Or install it yourself as:

$ gem install redis-ssdb-proxy

Usage

If you want migrate redis data to SSDB the below code will write data to both of redis and ssdb and read from redis only

The options ssdb: :slave tells Proxy which redis-client is connected to the ssdb server which means Proxy will be delegating the unsupport data-structure (set) of SSDB to supported(zset)

ssdb = Redis.new(host: 'localhost', port: '8888')
redis = Redis.new(host: 'localhost', port: '6379')

$redis = RedisSsdbProxy.new(master: redis, slave: ssdb, ssdb: :slave)

$redis.set(:quotes, 'May the force be with you') # set to both
$redis.get(:quotes) # read from master (redis)
# => May the force be with you

When the data migrated the below line code will being prepare for the rollback

$redis = RedisSsdbProxy.new(master: ssdb, slave: redis, ssdb: :master)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/falm/redis-ssdb-proxy.

License

MIT © Falm