Serializing objects in Jedis

2,932 views
Skip to first unread message

Peter

unread,
Feb 21, 2011, 11:31:12 AM2/21/11
to Jedis
Hi everyone,

I am Peter, a newbie to Jedis.
In the Jedis main page: https://github.com/xetorthio/jedis, I was told
that objects can always be serialized but I do not know how to do it.

For example, given a very common data structure like:

Hash <String Hashkey, List <Object> >

where the structure of an Object is

Object<String field1, String field2>

Suppose we use hashes and lists in Jedis, then how the commands in
Jedis would be?

Thank you in advance for assisting my question.
Peter

Jonathan Leibiusky

unread,
Feb 21, 2011, 3:20:13 PM2/21/11
to jedis...@googlegroups.com, Peter
Hi Peter,
I am not sure if I understood your question correctly. Jedis is a client for Redis and intends to be 1 to 1 with it.
Since redis doesn't support storing objects, everything is a string, you should find a way to convert your object into strings.
I have developed a java version of Ohm on top of Jedis, called JOhm (github.com/xetorthio/johm) which will store your objects as hashes in redis and also use Sets to make some indexes for very basic searches.

I don't know if this helps in anyway. If not, try to give some examples and I will be happy to help! :)

Jonathan
Reply all
Reply to author
Forward
0 new messages