Reputation: 520
Let's say I have a document in the following format in MongoDB:
students: Array
grades: Array
I currently have about 10,000 students and grades that are constantly changing. The number of students is constantly growing and students are removed from the document. I have a process to update the document every 30 minutes. At the same time, I've built an ExpressJS API where various teachers query the database as often as every minute to view info about their students.
Upvotes: 0
Views: 34
Reputation: 10737
With so many ( 10k students/grades - elements in array ) maybe better if you have single document per student/grade in collection so you update the relevant student document only.
You need to adapt the schema based on the use cases , I guess not every time teachers need to read the full list of students/grades , but just students per class or lesson or school , guessing here since I dont see your exact use case and document example ...
Upvotes: 1