Infinispan Server includes an endpoint that implements the RESP3 protocol and allows you to interact with remote caches using Redis clients.
1. Using the RESP endpoint
Infinispan Server includes a module that implements the RESP3 protocol. The RESP endpoint allows Redis clients to connect to one or several Infinispan-backed RESP servers and perform cache operations.
The RESP endpoint is enabled by default on the single-port endpoint. Redis client connections will automatically be detected and routed to the internal connector.
Unresolved directive in ../../stories/assembly_resp_endpoint.adoc - include::../topics/proc_server_enabling_resp.adoc[leveloffset=+1] :leveloffset: +1
2. Mapping caches to Redis logical databases
Use the cache aliases
configuration attributes to map caches to Redis logical databases.
The default respCache
is mapped to logical database 0
.
Infinispan can use multiple logical databases even in clustered mode, as opposed to Redis which only supports database
|
2.1. Redis commands
The Infinispan RESP endpoint implements the following Redis commands:
-
This commands includes all required fields, but some fields are set to 0
as they do not apply to Infinispan. -
See the MULTI command.
-
This command behaves like FLUSHDB
since Infinispan does not support multiple Redis databases yet. -
This command is deprecated. Use the SET
command with the appropriate flags instead. -
This implementation attempts to return all attributes that a real Redis server returns. However, in most cases, the values are set to 0
because they cannot be retrieved, or don’t apply to Infinispan. -
The current implementation has a time complexity of O(N), where N is the size of the list. -
The current implementation is atomic for rotation when the source and destination are the same list. For different lists, there is relaxed consistency for concurrent operations or failures unless the resp cache is configured to use transactions. -
This command will return the memory used by the key and the value. It doesn’t include the memory used by additional metadata associated with the entry. -
This command will return the same fields as a real Redis server, but all values will be set to 0
. -
This command always returns an empty list of modules. -
The current implementation has a relaxed isolation level. Redis offers serializable transactions, but Infinispan provides a read-uncommitted isolation. -
This command is deprecated. Use the SET
command with the appropriate flags. -
Cursors are reaped in case they have not been used within a timeout. The timeout is 5 minutes. -
Infinispan allows the SELECT command both in local and clustered mode, unlike Redis Cluster which forbids use of this command and only supports database zero. -
This command is deprecated. Use the SET
command with the appropriate flags instead. -
This command is deprecated. Use the SET
command with the appropriate flags instead. -
This command is deprecated. Use the GETRANGE
command instead.