What would be better long term: Creating many documents in MongoDB or fewer documents with nested arrays
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).


Arrays which potentially grow without bound are an antipattern for performance and usability.

I would recommend having each quiz in a separate document for reasons including:


Better granularity for server memory management and document updates. When you retrieve or update a single quiz, the MongoDB server does not have to fetch/update a large document with all the quizzes for that user.
Easier to manipulate documents in your application code. Arrays of arrays are awkward to work with and have extra overhead if if you want to pull out a subset of elements via server-side manipulation. Similarly, if you wanted to provide a list of active/available quizzes in your application it would be easier to have quiz as a top-level object.
Avoid worrying about hitting the document size limit (16MB as at MongoDB 3.2). If users post many (or large) quizzes, a single document per user makes the document limit a much more likely issue to have to deal with in your application code.


For more information, see: Why shouldn't I embed large arrays in my documents?.