Infinispan Server includes an endpoint that implements the RESP3 protocol and allows you to interact with remote caches using Redis clients.

include::../topics/proc_server_configuring_resp.adoc :leveloffset: +2

1. 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 0 when using Redis Cluster.

1.1. Differences between Infinispan and Redis implementation

Infinispan provides different guarantees compared to Redis for some functionalities. This chapter summarizes the differences and, when possible, alternative configurations for a similar behavior.

1.1.1. Isolation

Redis utilizes a single thread to handle user requests, which provides serializable isolation and atomic behavior for multi-key requests. Infinispan provides a relaxed isolation level, which is configurable. Concurrent requests might perceive a partial result for commands that access multiple keys, such as MSET, where only a subset of the keys were inserted in the cache before the operation finishes.

The only alternative in Infinispan for an atomic behavior is to submit multi-keys operations within a MULTI…EXEC block. However, this requires configuring the default cache with transactional capabilities.

Infinispan does not provide serializable transactions. See the cache configuration guide for more information.

1.1.2. Transactions

Applications utilizing the MULTI…EXEC commands should update the default cache configuration to enable transactional capabilities. Transactions in Redis do not have the concept of rollback to revert in case of failures. Infinispan provides ACID transactions and rollback in case of failures. Additionally, the transactions are distributed in cluster mode and can operate across many slots.

The recommended configuration utilizes PESSIMISTIC locking and transaction mode different from NONE. See the cache configuration guide for more information.

1.2. Redis commands

The Infinispan RESP endpoint implements the following Redis commands: