You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would appear that MGET ZRANGE can be chained together in Redis to allow you to return the keys matching the result of a ZRANGE or ZRANGEBYSCORE command. This means that we can reduce the chatter between redis-hq from node and Redis by 1/2 for all data retrieval functions.
A caveat of this is that we need to store the full key for each entity within the sorted set indexes. In order to avoid prefixing the ids with the type name, we could have a global ID rather than an ID per type.
This creates another minor problem which is that it becomes possible to retrive an object of the wrong type with Type.find(). In order to prevent this we could validate the type by storing a "_type" attribute with all stored JSON objects.
The text was updated successfully, but these errors were encountered:
It would appear that MGET ZRANGE can be chained together in Redis to allow you to return the keys matching the result of a ZRANGE or ZRANGEBYSCORE command. This means that we can reduce the chatter between redis-hq from node and Redis by 1/2 for all data retrieval functions.
A caveat of this is that we need to store the full key for each entity within the sorted set indexes. In order to avoid prefixing the ids with the type name, we could have a global ID rather than an ID per type.
This creates another minor problem which is that it becomes possible to retrive an object of the wrong type with Type.find(). In order to prevent this we could validate the type by storing a "_type" attribute with all stored JSON objects.
The text was updated successfully, but these errors were encountered: