I am writing a website which has a bunch of posts and allows users to favorite posts.
What I am wondering is what would be the best implementation that will allow users to search their favorites?
There will be around 4,000,000 posts and users will likely favorite about 100,000 posts, so I am not sure what would be the best implementation. I was thinking maybe have a index called favorites and have each user id with an array of post ids and then filter the posts index by the favorites index. But I am not too familiar with how to do this.
Thank you for any suggestions!