What is best practice in redis when we need to store multiple objects of same category?
Currently I store the whole object as json string.
For ex: Books.
{
title:...,
author:...
}
Option 1:
set book:1 book1
set book:2 book2
set book:3 book3
usage: get book:1
will give me the book object.
Option 2: hash
hset book 1 book1
hset book 2 book2
hset book 3 book3
usage: hget book 1
will give me the whole book object
Is there any huge difference in terms of performance or usage etc? Please share if you think of any other approach!