I have a map of sets of unique objects, unique based on it's GUID as key, and sorted by timestamp, a 64-bit signed integer in descending order. The sets are keyed by a GUID and every individual object in the each set should be able to be retrieved by it's GUID in O(1). I need to store this map into Redis cache. I have read of Redis Ordered Set. However, my question is how to ZADD
the object into the ordered set for later retrieval by the object's GUID as key in O(1) time and sorted by the 64-bit signed int timestamp in descending order? Thanks.
Asked
Active
Viewed 283 times
0

Kok How Teh
- 3,298
- 6
- 47
- 85
-
Just to make sure I got you right, you want the set unique value is the GUID but you want to retrieve sorted by the timestamp? why do you need a set do you get the GUID updated more than once? – Guy Korland Nov 08 '20 at 17:34
-
It's like `LinkedHashMap` in Java. – Kok How Teh Nov 09 '20 at 01:32
-
Keyed on GUID and ordered on timestamp. – Kok How Teh Nov 09 '20 at 01:33