Cache System for millions of objects

Joined
Sep 19, 2023
Messages
1
Reaction score
0
I want to cache several million objects (with an ID, timestamp and some other properties). Then I want to query every few seconds all objects where the ID = abc and the timestamp >= 123. Which caching system would you recommend for this? Redis doesnt work, because you can't search the hashes by field values with it

example object
{
id: "idabc",
timestamp: 165485458435,
detailThingy: 123
}
 
Joined
Nov 13, 2020
Messages
302
Reaction score
38
I hate the words "...query every few seconds...". Why over-tax a computer like that? It sweats enough in normal use let's give it a break.
And if you're killing the internet with this nonsense to shame I say.
What would cause an object to change? That's where you should look and that can tip you off and querying becomes a dead issue.
More info and code are needed.
 
Joined
Nov 23, 2023
Messages
56
Reaction score
3
I want to cache several million objects (with an ID, timestamp and some other properties). Then I want to query every few seconds all objects where the ID = abc and the timestamp >= 123. Which caching system would you recommend for this? Redis doesnt work, because you can't search the hashes by field values with it

example object
{
id: "idabc",
timestamp: 165485458435,
detailThingy: 123
}
Store your objects with the ID and timestamp as part of the key. Additionally, include a separate key with "id:abc" to act as a tag. Every few seconds, query the "id:abc" key to retrieve a list of object IDs containing "abc". Then, use these IDs to fetch the actual objects from the cache.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top