Redis count number of keys where value list is included in an argument list

Viewed 140

I have a list of around 2M IDS representing people. Each ID is linked to a list of URLS visited. I have a list of banned URLS. I would like to know how many people have only visited banned sites. I would like to compute this info in less than 3 seconds. My idea is this one:

  • Get my data into redis: for each person, key would be its ID, value would be the list of URLS he visited.

  • When I need the number of people who visited only a list I have of banned URLS (let's call it x) : compute the number of keys where the associated list is included into the x list.

Does redis match my use-case? Is there a better way to represent my data into redis ? Is the time constraint (3 seconds) is achievable?

0 Answers
Related