I have a scenario I'm debating for my app.
Let's say I have a Quiz application with a MongoDB structure that looks like this:
{
_id: xxxxxx,
userId: xxxx,
quizData: [
{
name: xxxx,
quizId: xxxx,
questions: [...]
},
{
name: xxxx,
quizId: xxxx,
questions: [...]
}
...]}
I'm torn between what's better long-term for my application: let each user have just one document and for each quiz he/she creates, it will be added to the "quizData" array of objects...OR...let each user's quiz have its own document in the MongoDB, where I create the above structure for each quiz (obviously, the "quizData" will only contain one object instead of an array of many).
Theoretically, the user can create as many Quizzes as they want, but realistically, that probably won't be the case. I fear that if I let each user have it's own document for each quiz in the MongoDB, it will populate the collection fast and over time (with many users doing the same), it will slow down the querying process.
Anyone have any thoughts on the best way to go about this?