my dev environment is the Laravel PHP framework utilising the predis client library.
I am probably overlooking certain aspects, and I am new to Redis however what I think am wanting is the hash data type for storing user information like so:
$redis->hmset('users', array('id' : 1, 'username' => 'ali', 'dob' => '29/06/89', 'email' => 'a@a.com'));
My question is however with the above is this the correct way of me storing all users with there information in ONE hash so I can retrieve all users together and retrieve an individual user by ID when necessary, as I am in need of displaying all users in a table on the front end, but also need to grab an individual user by there ID on occasion.
If not and I need to store each user in an individual hash like below with there ID as part of the key how do I retrieve all users in one go and ordered?
$redis->hmset('users:{id}', array('name' => 'ali', 'dob' => '29/06/89', 'email' => 'a@a.com'));
Many thanks for any help.