Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

167
Views
MongoDB blog with comments architecture

I want to build a blog system where it is possible to create posts with comments. The comments should be in chronological order, but they should also be able to be sorted by popularity (number of likes).

My first attempt was to create a document for each post and store the comments in an array. But this is not very good, because a document is limited with 16 MB.

Then I read about buckets, that sounds good but since the comments are in different buckets and I want to sort the comments by popularity, it is not very efficient.

i think keeping all posts in one collection and all comments in another collection and connecting them with foreign keys is not an elegant solution either.

Does anyone have any idea how to implement this?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!