Description
Jedis is a blazingly small and sane Redis java client.
Jedis was conceived to be EASY to use.
Jedis is fully compatible with redis 2.8.x and 3.0.x.
Jedis alternatives and similar libraries
Based on the "Database" category.
Alternatively, view Jedis alternatives based on common mentions on social networks and blogs.
-
MapDB
MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine. -
orientdb
OrientDB is the most versatile DBMS supporting Graph, Document, Reactive, Full-Text and Geospatial models in one Multi-Model product. OrientDB can run distributed (Multi-Master), supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries. -
Crate
CrateDB is a distributed and scalable SQL database for storing and analyzing massive amounts of data in near real-time, even with complex queries. It is PostgreSQL-compatible, and based on Lucene. -
ObjectBox embedded database
Android Database - first and fast, lightweight on-device vector database -
Chronicle Map
Replicate your Key Value Store across your network, with consistency, persistance and performance. -
JDBI
The Jdbi library provides convenient, idiomatic access to relational databases in Java and other JVM technologies such as Kotlin, Clojure or Scala. -
sql2o
sql2o is a small library, which makes it easy to convert the result of your sql-statements into objects. No resultset hacking required. Kind of like an orm, but without the sql-generation capabilities. Supports named parameters. -
JetBrains Xodus
Transactional schema-less embedded database used by JetBrains YouTrack and JetBrains Hub. -
FlexyPool
FlexyPool adds metrics and failover strategies to a given Connection Pool, allowing it to resize on demand.
InfluxDB high-performance time series database

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Jedis or a related project?
Popular Comparisons
README
Jedis
What is Jedis?
Jedis is a Java client for Redis designed for performance and ease of use.
Are you looking for a high-level library to handle object mapping? See redis-om-spring!
Contributing
We'd love your contributions!
Bug reports are always welcome! You can open a bug report on GitHub.
You can also contribute documentation -- or anything to improve Jedis. Please see contribution guideline for more details.
Getting started
To get started with Jedis, first add it as a dependency in your Java project. If you're using Maven, that looks like this:
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>4.2.0</version>
</dependency>
Next, you'll need to connect to Redis. For many applications, it's best to use a connection pool. You can instantiate a Jedis connection pool like so:
JedisPool pool = new JedisPool("localhost", 6379);
With a JedisPool
instance, you can use a
try-with-resources
block to get a connection and run Redis commands.
Here's how to run a single SET command within a try-with-resources block:
try (Jedis jedis = pool.getResource()) {
jedis.set("clientName", "Jedis");
}
Jedis
instances implement most Redis commands. See the
Jedis Javadocs
for the complete list of supported commands.
Easier way of using connection pool
Using a try-with-resources block for each command may be cumbursome, so you may consider using JedisPooled.
JedisPooled jedis = new JedisPooled("localhost", 6379);
Now you can send commands like sending from Jedis.
jedis.sadd("planets", "Venus");
Connecting to a Redis cluster
Jedis lets you connect to Redis Clusters, supporting the Redis Cluster Specification.
To do this, you'll need to connect using JedisCluster
. See the example below:
Set<HostAndPort> jedisClusterNodes = new HashSet<HostAndPort>();
jedisClusterNodes.add(new HostAndPort("127.0.0.1", 7379));
jedisClusterNodes.add(new HostAndPort("127.0.0.1", 7380));
JedisCluster jedis = new JedisCluster(jedisClusterNodes);
Now you can use the JedisCluster
instance and send commands like you would with a standard pooled connection:
jedis.sadd("planets", "Mars");
Using Redis modules
Jedis includes support for Redis modules such as RedisJSON and RediSearch.
See the [RedisJSON Jedis](docs/redisjson.md) or [RediSearch Jedis](docs/redisearch.md) for details.
Documentation
The Jedis wiki contains several useful articles for using Jedis.
You can also check the latest Jedis Javadocs.
Troubleshooting
If you run into trouble or have any questions, we're here to help!
Hit us up on the Redis Discord Server or open an issue on GitHub.
You can also find help on the Jedis mailing list or the GitHub Discussions.
License
Jedis is licensed under the MIT license.
Sponsorship
*Note that all licence references and agreements mentioned in the Jedis README section above
are relevant to that project's source code only.