So I have been trying to migrate our DB from mysql to Redis using Jedis. I understand that on Redis, everything is key and value. But I have few basic questions.
1) Let's say I have a Mammals class which have eyes,ears,nose,hand,legs
as members. So now I can have multiple values e.g.
2,2,1,2,2
2,3,1,1,2
1,2,1,6,2
Each row denote the number they have. 2 eyes,2 ears, 1 nose, 2 hand,2 legs.
I wanted to store these data, like we used to do in mySQL, over there, each column will have their values. But using Jedis
how do I achieve that?
I tried using auto increment key value and storing all of them using jedis.sadd(jedis.get("counter"),stringg_value)
When I try to print any value using the index, I can very clearly see that, the values are not in the order in which I added. If I add the string value as "one,two, three, four" the outcome will be "four, two, three, one". And this is very random, it's not like all of the values will be in this format, they change too.
My question is how do I store csv formatted data into Redis?
2) how do I fetch data from Jedis
based on multiple conditions . like a mammal with 2 ear, 2 eyes and 4 hands. What approcah should I use?