https://github.com/falm/redis-ssdb-proxy
proxy that read from redis(or ssdb) write to both use for redis <=> ssdb migration on production
https://github.com/falm/redis-ssdb-proxy
proxy redis ssdb
Last synced: about 1 year ago
JSON representation
proxy that read from redis(or ssdb) write to both use for redis <=> ssdb migration on production
- Host: GitHub
- URL: https://github.com/falm/redis-ssdb-proxy
- Owner: falm
- License: mit
- Created: 2016-06-14T01:30:39.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-22T08:07:06.000Z (almost 10 years ago)
- Last Synced: 2025-04-17T17:58:02.415Z (about 1 year ago)
- Topics: proxy, redis, ssdb
- Language: Ruby
- Size: 24.4 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Redis SSDB Proxy [](https://travis-ci.org/falm/redis-ssdb-proxy) [](https://coveralls.io/github/falm/redis-ssdb-proxy?branch=master) [](https://codeclimate.com/github/falm/redis-ssdb-proxy) [](https://gemnasium.com/github.com/falm/redis-ssdb-proxy) [](https://badge.fury.io/rb/redis-ssdb-proxy)
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:
```ruby
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)
```ruby
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
```ruby
$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](https://github.com/falm)