Google Cloud Professional Cloud Architect — Question 68

You are creating an App Engine application that uses Cloud Datastore as its persistence layer. You need to retrieve several root entities for which you have the identifiers. You want to minimize the overhead in operations performed by Cloud Datastore. What should you do?

Answer options

Correct answer: A

Explanation

The correct answer is A because creating a Key object for each entity and executing a batch get operation is the most efficient way to retrieve multiple entities and reduces the number of operations performed. Option B is less efficient as it involves multiple get operations, which increases overhead. Options C and D involve query filters, which are not necessary when you already have the keys for the entities you want to retrieve.