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?