This document discusses implementing a Redis adaptor using Apache Geode. It provides an overview of Redis data structures and commands, describes how Geode partitioned regions and indexes can be used to store and access Redis data, outlines advantages like scalability and high availability, and presents a roadmap for further development including supporting additional commands and performance optimization.
12. Start Using GFSH
Redis Adaptor - Usage
12
gfsh>start server --name=server1 --redis-port=11211
--redis-bind-address=localhost
Creates a region type PARTITION by default
• Change Using system property
gemfireredis.regiontype
gfsh>start server --name=server1 --redis-port=11211
--J=-Dgemfireredis.regiontype=PARTITION_PERSISTENT
13. • Supports all Redis data structures
• Each data structure (except Strings) is
backed by a Geode Partitioned Region
• which is a horizontally scalable distributed
ConcurrentHashMap
• We create just one Partitioned Region for
storing all Strings
• Uses Geode’s OQL and indexes
Redis Adaptor - Implementation
13
14. • One Partitioned Region for
Each List
• Track “head” and “tail” position
in the Partitioned Region itself
as special entries
Future Exploration
• Embed the position in “Value”
• Place an index on the position,
should help with List Scan
Redis Adaptor - List
14
user dataposition
Key Value
15. • One Partitioned Region for
Each Sorted Set
• key is user data, value is user
provided score
• Index on score
Redis Adaptor - Sorted Set
15
scoreuser data
Key Value
17. • Scalability
• Server side stored procedures
• Network Partitioning
• WAN replication
Advantages
17
18. • Scale Vertically
• Redis server is single threaded
• Geode server supports high concurrency
• Utilize CPUs on big boxes without having to
manage more instances
• Scale data structures - Horizontally
Scalability
18
22. • Implement “All” Commands
• String: SETRANGE (overwrites part of string)
• List: BLPOP, BRPOPLPUSH (Block/insert into another)
• Sorted Set: ZINTERSTORE (intersect multiple Sorted
Sets and store result in another)
• etc.
• Performance benchmark
• Optimize
• Geode API for these data structures?
Roadmap
22