Hello,
I am going to be storing many objects (really more like serialized associative arrays) in Redis.
I want a way to easily remove/invalidate data that has certain attributes.
To make up an oversimplified example, let's say we have class rosters stored that I identify with attributes such as:
institution=B
year=2017
term=Fall
offering id=2939 (like the primary key)
But, I want to be able to invalidate all rosters based on any attributes I choose. For example:
For examples, I may want to remove data from redis:
Remove where institution=B
Remove where offering id=2939
Remove Where Institution=A and Year=2017 and term=Spring
Would the best way to set that up be having a key in Redis to use just for invalidation purposes?
For example the key for the above would be:
(institution=B)(offering id=2939)(term=Fall)(year=2017)
attributes would be in alphabetical order
And the value would be
offering id=2939
It would just be a pointer to the key for the actual data in Redis. The key for the actual data would be offering id=2939.
Then I can just look for
*(institution=B)*(year=2017)*
To just search on two attributes. Is this reasonable? Or is there a more simple solution?
Thanks,
Doug