What is the best Schema Design for a Movie Review App for storing Reviews, Likes, Comments, etc

Hello! I’m building a Movie Review project that’s a combination of a social media / blog app. I plan on using a 3rd party movie API like TMBDI Api to allow users to search and find movies they want to review. I spent a few days researching and trying stuff but I’m not too sure how to go about building an efficient schema around that. I’m hoping to get some help/guidance on how to do so. I watched the series on best practice/anti-patterns but still need extra assistance.

Basically, I want users to be able to write reviews for a movie that will show up down a timeline feed similar to any social media app like Twitter or Facebook. I’d like users to be able to like another user’s review and/or leave a comment. However when a user clicks the actual movie or the post the user made from the timeline it redirects them to that specific movie with all the data displayed from the tmbdi API and a collection of that specific movie with reviews from different users will appear along with any nested comments.

I think I’d need a schema/document collection for:

  1. Users
  2. User Reviews/Post
  3. Other User Comments
  4. Likes

and I’m thinking I could probably combine 2,3 & 4 together when displaying the entire collection of every related review for a specific movie? Or is it better to create a separate schema/collection for that. I’m pretty new to mongodb/mongoose but I built small mini projects.

Also: Would it be a lot to add a follower count?

Sorry for the long message hope my question wasn’t too complicated. Thanks in advance!

Hi @Ssjr ,

MongoDB has a sample IMDb database design , I think it might be a good start for you.

I recommend you review this design of the collections and see if you can use the same.

You can easily create a free Atlas cluster and load those sample data sets to play with and try out.

In general you can have:

Reviews collection:

  • include.movie reference data
  • include user data
  • include likes
  • include subscribers
  • can sort based on time field and index a userId to get all the latest reviews a user did

Movies collection:

  • data loaded from the API
  • any data that reviewers might add to a movie like avg review rating etc.

Comments collection:

  • reference to review
  • comments
  • embedded replys to comments

Let me know if you have follow up questions.

Ty

is it possible to update this sample? this exercise, as well as a similar exercise with the airbnb data sample, both have a lot of out of date information and it’s really hard to get going