I have a use case where I have to search by key and in another use case, I have to search by value. Given this scenario, what's the best approach as scanning the entire cache can degrade performance (to filter by value).
- Do reverse store i.e store value as key and key as the value in the same logical table?
- Use different database and store Value, Key as K | V. I see a few posts that suggest using a different database is a bad idea and deprecated?
Or is there a better alternative/approach?