MongoDB performance with growing data structure

后端 未结 4 2100
执念已碎
执念已碎 2020-12-06 02:42

Let\'s say we are designing a new system and have decided to use MongoDB as the primary database. The data schema is very similar to a blog with [growing] comments.

4条回答
  •  萌比男神i
    2020-12-06 03:12

    You could stick with MongoDB, but not embed all the comments into the main document, but just the most recent ones (limited by number), and keep all the rest in a separate collection.

提交回复
热议问题