
Answer-first summary for fast verification
Answer: Create the Key object for each Entity and run a batch get operation
The question asks for the most efficient way to retrieve multiple root entities using their identifiers while minimizing operational overhead in Cloud Datastore. Option A (batch get operation) is optimal because it allows retrieving multiple entities in a single API call, reducing overhead compared to multiple individual operations. This aligns with Google's best practices for batch operations. Option B (multiple get operations) is inefficient due to multiple API calls. Option C (batch query) is less efficient than direct key lookup as queries are more expensive operations. Option D (multiple queries) is the least efficient due to both multiple API calls and the inherent cost of query operations. The community discussion strongly supports A with high upvotes and references to official documentation.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are developing an App Engine application that uses Cloud Datastore as its persistence layer. You need to retrieve multiple root entities using their identifiers while minimizing the operational overhead in Cloud Datastore. What should you do?
A
Create the Key object for each Entity and run a batch get operation
B
Create the Key object for each Entity and run multiple get operations, one operation for each entity
C
Use the identifiers to create a query filter and run a batch query operation
D
Use the identifiers to create a query filter and run multiple query operations, one operation for each entity
No comments yet.