exam questions

Exam Professional Cloud Architect All Questions

View all questions & answers for the Professional Cloud Architect exam

Exam Professional Cloud Architect topic 1 question 64 discussion

Actual exam question from Google's Professional Cloud Architect
Question #: 64
Topic #: 1
[All Professional Cloud Architect Questions]

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?

  • 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
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
shashu07
Highly Voted 4 years, 6 months ago
Correct Answer: A Create the Key object for each Entity and run a batch get operation https://cloud.google.com/datastore/docs/best-practices Use batch operations for your reads, writes, and deletes instead of single operations. Batch operations are more efficient because they perform multiple operations with the same overhead as a single operation. Firestore in Datastore mode supports batch versions of the operations which allow it to operate on multiple objects in a single Datastore mode call. Such batch calls are faster than making separate calls for each individual entity because they incur the overhead for only one service call. If multiple entity groups are involved, the work for all the groups is performed in parallel on the server side.
upvoted 50 times
AzureDP900
2 years, 2 months ago
works fine .. A is right
upvoted 2 times
...
...
AWS56
Highly Voted 4 years, 11 months ago
Agree A
upvoted 7 times
...
halifax
Most Recent 3 months, 3 weeks ago
Selected Answer: A
An old question, no more datastore. in 2025 you can use Firestore in datastore mode.
upvoted 2 times
...
de1001c
6 months, 3 weeks ago
Keep in mind that datastore is discontinued, Firestore being the recommended alternative.
upvoted 4 times
...
don_v
11 months, 1 week ago
According to "A. Create the Key object for each Entity and run a batch get operation" which is wrong as the key is already created for each entity whenever it's persisted. I believe the correct answer is C, -- to use a bulk query (a.k.a. "batch" in their terms). You need a query with a criteria anyway to find a resultset, and not just a fetch by "get" operation to load by surrogate keys.
upvoted 3 times
...
vamgcp
1 year, 10 months ago
By using the "lookup by key" API of Cloud Datastore, you can minimize the overhead in operations performed by Cloud Datastore and optimize the performance of your App Engine application. from google.cloud import datastore client = datastore.Client() keys = [client.key('EntityKind', id) for id in entity_ids] entities = client.get_multi(keys)
upvoted 3 times
...
omermahgoub
1 year, 12 months ago
A. Create the Key object for each Entity and run a batch get operation To minimize the overhead in operations performed by Cloud Datastore, you should use the batch get operation to retrieve multiple entities in a single API call. To do this, you should create a Key object for each entity that you want to retrieve, then pass the Key objects to the batch get operation. This will allow you to retrieve multiple entities in a single API call, reducing the number of operations performed by Cloud Datastore and improving the efficiency of your application.
upvoted 6 times
omermahgoub
1 year, 12 months ago
Option B, running multiple get operations, one operation for each entity, would not be an efficient way to retrieve the entities because it would require multiple API calls to Cloud Datastore, which would increase the overhead and decrease the efficiency of the application. Option C, using the identifiers to create a query filter and running a batch query operation, would not be an efficient way to retrieve the entities because it would require performing a query operation, which is generally more expensive than a get operation. Option D, using the identifiers to create a query filter and running multiple query operations, one operation for each entity, would not be an efficient way to retrieve the entities because it would require performing multiple query operations, which are generally more expensive than get operations.
upvoted 6 times
...
...
megumin
2 years, 1 month ago
Selected Answer: A
A is ok
upvoted 1 times
...
Mahmoud_E
2 years, 1 month ago
Selected Answer: A
A is correct https://cloud.google.com/datastore/docs/best-practices#api_calls
upvoted 2 times
...
RitwickKumar
2 years, 3 months ago
Selected Answer: A
https://cloud.google.com/datastore/docs/concepts/entities#datastore-datastore-batch-lookup-python
upvoted 3 times
...
haroldbenites
3 years ago
go for A.
upvoted 2 times
...
vincy2202
3 years ago
A is the right answer
upvoted 2 times
...
joe2211
3 years ago
Selected Answer: A
vote A
upvoted 2 times
...
MaxNRG
3 years, 1 month ago
A – create a key object for each entity, and run a batch get operations. See Batch Operations section here: https://cloud.google.com/datastore/docs/concepts/entities var keys = new Key[] { _keyFactory.CreateKey(1), _keyFactory.CreateKey(2) }; var tasks = _db.Lookup(keys[0], keys[1]); 1 and 2 are identifiers of the Key. Check Key / Identifier definition on the same link (top of that page) Such batch calls are faster than making separate calls for each individual entity because they incur the overhead for only one service call.
upvoted 1 times
...
victory108
3 years, 6 months ago
A. Create the Key object for each Entity and run a batch get operation
upvoted 1 times
...
un
3 years, 7 months ago
A is correct
upvoted 1 times
...
Ausias18
3 years, 8 months ago
Answer is A
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...