I need to use two key values in Redis cache so that I can retrieve based on one Key? Kindly help on this,
Both keys would be string, and the value will be an entity where the key values will also be present.
Example:
: <compressed_json>
json structure:
result{
a{
key: <something>
b:<something>
c:<something>
}
}
I need to get value from redis, either by using key or by ‘b’, but i wouldn’t have both values at the same time.
2
Answers
To implement the feature, it needs to build a simple Inverted index like below diagram, store your data as three parts.
Index data with inverted index
Get The Document by index (key 1 or key N)
Another solution would be to deploy RediSQL it will give you access to a fully functional SQL database, where you can query for both keys.