Redy is DynamoDB client to cache data in Redis. It depends on fluent-plugin-dynamodb-alt.
- High availability. There is no significant impact Redis is down.
- Speed. You can quickly access the object because it is cached in Redis.
- Capacity. large capacity at a cheap price ($205 / 120GB r:100 w:100 / month)
redy = Redy.new(
redis: {namespace: 'redy', host: 'example.com', port: 7777, expire_after: 86400, negative_cache_ttl: 300},
fluent: {tag: 'dynamodb.test', host: 'localhost', port: 24224, redis_error_tag: 'redis.error'},
dynamodb: {table_name: 'my_table', timestamp_key: 'timestamp', access_key_id: '...', secret_access_key: '...', region: 'us-east-1', delete_key: 'delete'})
redy.set('foo', {'bar' => 100, 'zoo' => 'baz'}, :async => true)
p redy.get('foo') #=> {'bar' => 100, 'zoo' => 'baz'}
redy.delete('foo')
redy.set('bar', 100, :expire_after => 5)
p redy.get('bar') #=> 100
See fluent-plugin-dynamodb-alt.
<match dynamodb.**>
type dynamodb_alt
aws_key_id AKIAIOSFODNN7EXAMPLE
aws_sec_key wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
region ap-northeast-1
table_name my_table
timestamp_key timestamp
binary_keys data
delete_key delete
expected id NULL,timestamp LE ${timestamp}
conditional_operator OR
flush_interval 1s
</match>
brew install redis
npm install -g dynalite
bundle install
bundle exec rake
- Use MessagePack to serialize. (You can not save complex objects)
- The maximum recode data size is 64KB. (There is improvement plan)