
Answer-first summary for fast verification
Answer: Create the Key object for each Entity and run a batch get operation
The correct answer is A: 'Create the Key object for each Entity and run a batch get operation.' According to Google Cloud Datastore best practices, using batch operations for reads, writes, and deletes is more efficient than performing individual operations because they reduce the total overhead by combining multiple operations into a single API call. By creating Key objects for each entity and running a batch get operation, you can retrieve multiple entities in a single call, minimizing the overhead and improving the overall efficiency of your application. References: https://cloud.google.com/datastore/docs/best-practices
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are developing an application on Google App Engine that leverages Google Cloud Datastore as the backend persistence layer. Your application needs to retrieve multiple root entities for which the unique identifiers are already known. Given the goal to minimize operational overhead in Cloud Datastore, what is the optimal approach to retrieve these entities efficiently?
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.