jedis
Redis Java client
The official Java library for connecting to a Redis server, add it to your Maven or Gradle project and store, retrieve, and manage data with simple Java method calls.
Jedis is the official Java client library for Redis, maintained by the Redis organization. Redis is an in-memory data store commonly used by applications to cache data, manage sessions, or handle fast lookups. Jedis provides Java applications with a straightforward way to connect to a Redis server and send commands to it, such as storing values, retrieving them, and working with Redis data structures like sets, hashes, and sorted sets.
The library is added to a Java project as a dependency through Maven or Gradle, the standard build tools used in Java development. Once connected, developers write simple method calls in Java that correspond to Redis commands. The library handles the network communication and translates those calls into the Redis protocol behind the scenes.
Beyond basic key-value operations, Jedis supports connecting to Redis Clusters, which are multi-server setups used when a single server is not enough. It also includes failover support, meaning it can automatically switch to a backup Redis server if the primary one becomes unavailable. Newer versions support token-based authentication including integration with Microsoft Entra ID for cloud deployments.
The library is versioned to track both Redis server versions and Java version compatibility. The README includes a compatibility table showing which Jedis versions work with which Redis and Java versions. Support is available through a Discord server and GitHub Discussions.
Where it fits
- Add Redis caching to a Java application with simple get, set, and expire method calls via Maven or Gradle.
- Connect a Java backend to a Redis Cluster for high-availability data storage across multiple servers.
- Set up automatic failover so a Java app switches to a backup Redis server if the primary goes down.
- Authenticate a Java app to a cloud-hosted Redis instance using Microsoft Entra ID token-based auth.