Note: This feature is experimental and is subject to change in future releases of VMware Tanzu GemFire.
The Tanzu GemFire Redis adapter allows Tanzu GemFire to function as a drop-in replacement for a Redis data store, letting Redis applications take advantage of Tanzu GemFire’s scaling capabilities without changing their client code. Redis clients connect to a Tanzu GemFire server in the same way they connect to a Redis server, using an IP address and a port number.
To use the Redis Adapter, you will need three pieces of information:
The IP address and port number should be the same ones coded in the Redis clients.
In order to take advantage of Tanzu GemFire’s scaling capabilities, you should specify the Tanzu GemFire region as one of the types that use the PARTITION data policy. PARTITION is the default. Other possibilities include PARTITION_REDUNDANT and PARTITION_PERSISTENT. (See “Region Shortcuts Quick Reference” for a complete list.)
To implement a Tanzu GemFire instance using the Redis Adapter:
--redis-port
to specify the port. This parameter is required -- the Tanzu GemFire server will listen on this port for Redis commands.--redis-bind-address
to specify the IP address of the server host. This parameter is optional. If not specified, the default is determined from the /etc/hosts file.--J=-Dgemfireredis.regiontype
to specify the region type. This parameter is optional. If not specified, regiontype is set to PARTITION.For example:
gfsh> start server --name=server1 --redis-bind-address=localhost \
--redis-port=11211 --J=-Dgemfireredis.regiontype=PARTITION_PERSISTENT
Redis clients can then connect to the server at localhost:11211.
The Tanzu GemFire Redis Adapter supports all Redis data structures, including
In Tanzu GemFire these data structures are implemented using partitioned regions. In most cases, Tanzu GemFire allocates one partitioned region for each data structure. For example, each Sorted Set is allocated its own partitioned region, in which the key is the user data and the value is the user-provided score, and entries are indexed by score. The two exceptions to this design are data types String and HyperLogLog. All Strings are allocated to a single partitioned region. Similarly, all HyperLogLogs are allocated to a single region. Regions use Tanzu GemFire’s OQL and indexes.
The Tanzu GemFire Redis Adapter supports all Redis commands for each of the Redis data structures. (See the Javadocs for the GemFireRedisServer class for a detailed list.) The Tanzu GemFire server’s responses to Redis commands are identical to those of a Redis server with the following exceptions, resulting from Tanzu GemFire’s more extensive partitioning model:
Tanzu GemFire’s primary advantage is its scalability. While the Redis server is single threaded, Tanzu GemFire supports high concurrency. Many Redis clients can execute commands on the Tanzu GemFire server simultaneously.
Tanzu GemFire supports stored procedures, which can execute on the server and report results to the requesting client.
Tanzu GemFire architecture and management features help detect and resolve network partitioning problems without explicit management on the part of the Redis client.
Tanzu GemFire WAN replication allows the data store to expand horizontally, across physically distant sites, while maintaining data consistency.