You have identifiers for several root entities in Cloud Datastore and want to minimize datastore operation overhead when retrieving them. What should you do?
Choose an answer
Tap an option to check your answer.
Correct answer: Construct a Key for each entity and perform a batch get operation..
Why this is the answer
A batch get operation is the most efficient way to retrieve multiple entities by their keys in Cloud Datastore. By constructing a Key for each root entity and using a batch get, you minimize network round trips and Datastore operation overhead compared to individual get operations. Individual get operations would incur a separate network call for each entity, increasing latency and cost. Using query filters, even in a batch query, is less efficient than a direct key lookup because queries involve indexing and potentially scanning, which are more resource-intensive than retrieving by a known key. Multiple queries per entity using filters would be the least efficient option.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed