Is there a guide for how to best design indexes? I’m new to aloglia and don’t have experience for how different structures will play out.
-
Should I have separate indexes for each use case in our app. Where I might be able to repurpose an index by adding some additional fields, should I do that?
-
Should I try to put all the fields for a specific use case into a single index (which will leave some values in columns blank) or is it better to query across indexes?
Here’s my specific use cases, but I’m also asking more generally how do I see around the corner into what structures are better than others?
Use case #1: Enable users to search for other users in my groups OR other users who I’ve met. Is this one index (eg. combo of users in my groups + users who I’ve met in one index) or should I split this data out as two indexes similar to how this data is stored in our source database?
What might this look like as a single index?
user_id | group(y/n) | met(y/n)| other_user_id | other_user_fields ???
Use case #2: I have a similar search as use case #1 but now the users wants to search for notes she’s taken from meetings with specific people. Should I try to build this onto the other index?
user_id | group(y/n) | met(y/n)| other_user_id | other_user_fields | my_notes ???
What are the implications for maintaining the different structures?