Best Redis Library for Java

The Redis official homepage lists JDBC-Redis and JRedis. What are the advantages / disadvantages of each? Are there any other options?

+71
java redis
Jun 15 '10 at 16:18
source share
7 answers

You can also use Jedis , which is also located on the official Redis customer page . It is compatible with the latest version of Redis.

Update

As of June 2012, Jedis is the Java client library recommended by the official Redis page.

+72
Aug 26 '10 at 19:55
source share

I tried JDBC-Redis, Jredis and Jedis. JDBC-Redis is poorly versed in performance. JRedis and Jedis are both fast, I use Jredis for times, but now I prefer Jedis because it is simple and I can handle network connection errors as I want.

+12
Nov 05 '10 at 18:57
source share

Both Jedis and JRedis are actively developing. I personally use Jedis as it seems to be more actively developing.

Spring provides a wrapper for both implementations, and they provide serialization / deserialization, among other things:

Person p = new Person("Joe", "Trader", 33); template.convertAndSet("trader:1", p); Person samePerson = template.getAndConvert("trader:1", Person.class); Assert.assertEquals(p, samePerson); 

http://git.springsource.org/spring-data/spring-keyvalue-redis/

UPDATE Spring Now added support for a third library called rjc (Redis Java Client) - I do not know what the pros and cons for it are.

+10
01 Oct '10 at 11:29
source share

A simpler solution is not to worry about working at the lowest level, but instead use a Hash Mapper (OHM) object, such as JOhm. JOhm allows users to decorate their existing objects with familiar annotations to ensure Redis is consistent without any invasive code changes. It does not even need any external configuration. You can think of OHM as the NoSQL equivalent of ORM RDBMS.

JOhm posted here

+5
Nov 02 '10 at 21:09
source share

just an update: it seems that jredis is no longer active, jedis, however, is highly developed and has some great features recently implemented, it is also the same JOhm developer.

extract from their readme on github:

Okay ... so what can I do with Jedis? [...]

Deals

Conveyor belt

Publish / Subscribe

Constancy

management teams

Server Remote Management Commands

Connection pool

Sharding (MD5, MurmureHash)

Key tags for edging

Conveyor lining

I used jredis until recently on half a dozen projects, moved them all to jedis in no time, no surprises.

+4
Dec 15 '10 at 21:46
source share

Jedis is a very good customer. I used jedis to conduct a performance test against redis. 50 clients, 1 million. Requests completed in 20 seconds (on an old intel 2core 2.6g machine, network 100 m). I believe that performance can be much higher if I can use a 1000m network for the test.

+4
May 17 '12 at 9:39 a.m.
source share

JDBC-Redis is just a JDBC wrapper for the JRedis database.
If you plan to use your code with different ends, then JDBC is a good way. NOTE. This is not a complete JDBC implementation, and NOSQL will go through.
If you intend to stay with Redis, I would suggest using an API that will give you more flexibility. Use the DAO layer template to encapsulate access to the database and down the road, and that’s all you need to change.

+2
Jun 15 '10 at 17:50
source share



All Articles