PROFESSIONAL-DATA-ENGINEER · Question #47
You are deploying a new storage system for your mobile application, which is a media streaming service. You decide the best fit is Google Cloud Datastore. You have entities with multiple properties, s
The correct answer is A. Option A. The specific text for Options A–D wasn't included in the question (each is just labeled "Option A/B/C/D"), so a precise per-option breakdown isn't possible. That said, here is the core concept the question is testing: The correct approach (Option A) is to use separate composite i
Question
Movie' the property actors' and the property tags' have multiple values but the property date released' does not. A typical query would ask for all movies with actor=<actorname> ordered by date_released or all movies with tag=Comedy ordered by date_released. How should you avoid a combinatorial explosion in the number of indexes?Exhibit
Options
- AOption A
- BOption B.
- COption C
- DOption D
How the community answered
(17 responses)- A71% (12)
- B18% (3)
- C6% (1)
- D6% (1)
Explanation
The specific text for Options A–D wasn't included in the question (each is just labeled "Option A/B/C/D"), so a precise per-option breakdown isn't possible. That said, here is the core concept the question is testing:
The correct approach (Option A) is to use separate composite indexes per query pattern - one on (actors, date_released) and one on (tags, date_released) - rather than a single composite index spanning all multi-valued properties together.
Why combinatorial explosion happens: Cloud Datastore writes one index row per combination of values. If a movie has 5 actors and 4 tags, a composite index on (actors, tags, date_released) would write 5 × 4 = 20 entries just for that one entity. With large multi-valued properties, this multiplies into an unmanageable number of index entries.
The fix: Keep multi-valued properties in separate composite indexes tied to the specific query they serve. Queries that filter on only one multi-valued property at a time (actors OR tags, not both) don't trigger cross-multiplication.
Distractors typically suggest creating one index covering all properties at once, indexing every property individually with no composite structure, or disabling indexes entirely - all of which either cause the explosion, miss query support, or break filtering.
Memory tip: Think "one multi-valued property per composite index." The moment two multi-valued properties share an index, entries multiply - like a combinatorial Cartesian product.
Topics
Community Discussion
No community discussion yet for this question.
