Topic 1 Question 64
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?
Create the Key object for each Entity and run a batch get operation
Create the Key object for each Entity and run multiple get operations, one operation for each entity
Use the identifiers to create a query filter and run a batch query operation
Use the identifiers to create a query filter and run multiple query operations, one operation for each entity
ユーザの投票
コメント(17)
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.
👍 41shashu072020/06/15Agree A
👍 7AWS562020/01/12A. 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.
👍 3omermahgoub2022/12/21
シャッフルモード