I have two tables in mysql, tasks and users. How do I model it in redis ? which data structure to use ?
E.g.,
tasks
-------------------------------------------
id name assigned_to cretead_at
-------------------------------------------
1 task1 1 2012-09-10 00:00:00
-------------------------------------------
2 task2 2 2013-09-11 00:00:00
--------------------------------------------
users
-------------------
id name email
-------------------
1 user1 abc@xyz.com
--------------------
2 user2 efg@xyz.com
-------------------
My requirement is, I have user id and wish to load all fields in to php array. I don't want to fetch single field like only name of user. I want to load users all info in php array for particular user id e.g.
$user[1] = array("name" => "user1", "email" => "abc@xyz.com");
It would be better if I could categories it under different sets like "users" and "tasks" instead of storing it in many keys.