I'm trying to decide which data structure should I use for a particular project on Redis. We're supposed to create a data base that's able to store metadata about calls, emails and Whatsapp messages (i.e date, time) and then find out, for example, every call a specific person made on May 14th
The problem is that I'm pretty new to Redis so I was trying to store the data about a person, the calls, the emails and the whatsapp messages on hashes like so:
hmset person:1 name John phone_n 001 email "a@a" wpacc 100,
hmset call:1 date "5/14...",
hmset email:1 origacc "a@a"... and so on. But I came to realize that this method wouldn't help me when querying for the data I need.
Guess I'm supposed to use sets or sorted sets, but I don't know how to use them for my purposes: should I store the data about a call like:
sadd calls:originnum 001,
sadd calls:destnum 002? But then, how would I be able to correlate that origin phone number with the date it called the destination phone number?
If you could point me in the right direction it would be really helpful. Thanks in advance