I am trying to get my head around the Redis/NoSQL way or designing database but I need some advice. I have the following model:
User {
long UserId
string Username
string Password
List<long> ActivityIds
}
Activity {
long ActivityId
long UserId
long CourseId
string Name
string Description
}
I understand that the best way to store a list of activities associated with the user is to store a list of ids. A user can potentially have 500+ activities associated, so I don't really want to load every activity every time I load the user to display a list of them.
Is it possible in Redis and more specifically ServiceStack.Redis to select by a foreign key? For example, select all activities by UserId & CourseId at the same time? Or am I miss understanding the best way to work with Redis?