PROFESSIONAL-CLOUD-DATABASE-ENGINEER · Question #150
PROFESSIONAL-CLOUD-DATABASE-ENGINEER Question #150: Real Exam Question with Answer & Explanation
The correct answer is B: Denormalize documents. Firestore automatically creates single field indexes for most fields which means each document write updates multiple index entries and drives up write and storage costs. By trimming indexes to only the ones required by your queries on steps, sessionDuration and energyBurned you
Question
Your application stores session documents in Firestore and queries them by steps, sessionDuration, and energyBurned. After a 30 day test period, latency is acceptable but costs are high. Which Firestore change would reduce cost while preserving performance and availability?
Options
- AAdd Cloud Memorystore cache
- BDenormalize documents
- CTrim Firestore indexes to only required ones
- DUse batched writes for lower cost
Explanation
Firestore automatically creates single field indexes for most fields which means each document write updates multiple index entries and drives up write and storage costs. By trimming indexes to only the ones required by your queries on steps, sessionDuration and energyBurned you reduce index write amplification and index storage while preserving the performance of the queries you care about. This is a configuration change that does not reduce availability because Firestore remains fully managed and you keep the essential indexes for your filters and sort orders. You can delete unused composite indexes and add single field index exemptions for attributes that are not part of your supported query patterns. Monitor index usage and keep only the minimal set that powers production queries so you sustain acceptable latency while lowering cost.
Topics
Community Discussion
No community discussion yet for this question.