I am using MongoDB to store Multi tenant Data. I have a use case where i need to show the feeds just like facebook .
Requirement:
- Show the feeds in descending order by date
- By modules .
Following is my compound shard key tenant_id, module, date.
Query:
Can i just use prefix of shard key tenant_id, module sort by desc order date limit 5 skip 10. - Will the above query have any performance impact on the server?
- Is this the right way to query? Or do we have any alternate solution?