Reputation: 377
For example i have array of objects
messages = [
{
name: user1,
messages: [
{
user2: [message1, message2]
}
]
},
{
name: user2,
messages: [
{
user1: [message1, message2]
}
]
}
]
What is the best way to store it in redis cache? I would want to update it each time message is sent.
Upvotes: 0
Views: 550
Reputation: 842
There are multiple ways to store this information in redis.
Make jsonString of object and store simple key/Value pair.
Use HashMap to store the jsonObject in redis.
For use case go for the option 1.
Upvotes: 1