I am working on a quiz game, where players have to answer questions of different categories (sports, music, .....). Right now, I have two different ideas how to store these categories /questions in Firestore:
- Creating a new Root-level collection for each category. Every document in this collection would define a question of that category. Stcuture would look like this:
- user_collection
- user_1_document
- user_2_document
- user_X_document
- music_questions_collection
- music_questions_1_document
- music_questions_2_document
- music_questions_X_document
- sports_questions_collection
- sports_questions_1_document
- sports_questions_2_document
- sports_questions_X_document
- user_collection
- Creating ONE Root-level collection and create a document inside this collection for each category, where each document contains a subcollection of questions:
- user_collection
- user_1_document
- user_2_document
- user_X_document
- category_collection
- music_document
- music_question_subcollection
- music_question_document_1
- music_question_document_2
- music_question_document_3
- music_question_subcollection
- sports_document
- sports_question_subcollection
- sports_question_document_1
- sports_question_document_2
- sports_question_document_3
- sports_question_subcollection
- music_document
I have already read about some advantages and limitations of subcollections and root-collections, but have not found enough information regarding read-costs and speed for this specific use case. Can anyone give me some information about drawbacks and advantages of the two listed approaches.