Topic 1 Question 108
You are developing an application that will allow users to read and post comments on news articles. You want to configure your application to store and display user-submitted comments using Firestore. How should you design the schema to support an unknown number of comments and articles?
Store each comment in a subcollection of the article.
Add each comment to an array property on the article.
Store each comment in a document, and add the comment's key to an array property on the article.
Store each comment in a document, and add the comment's key to an array property on the user profile.
ユーザの投票
コメント(14)
Selected: A Firestore has a “hierarchical structure”: collection contains documents, document can contain (sub)collections D does not make sense bc why do you want to link comments to the user profile instead of the article? https://stackoverflow.com/questions/48634227/limitation-to-number-of-documents-under-one-collection-in-firebase-firestore “There is no documented limit to the number of documents that can be stored in a Cloud Firestore collection. The system is designed to scale to huge data sets.”
👍 14p42022/01/21Why D and not C? For my understanding, we need to keep a relation between the articles and their comments. I don't see how the user profile could come in handy... but please let me know if I misunderstood something. For me, Ans C makes more sense.
👍 6htakami2022/03/26- 正解だと思う選択肢: D
P4 : re: D does not make sense bc why do you want to link comments to the user profile instead of the article?
Agreed use case here is we need to track user activity and using D option yiu can connect each comment back to article
👍 5GCPCloudArchitectUser2022/02/26
シャッフルモード