0 votes
in AWS by

You have created an Amazon DynamoDB table with Global Secondary Index. Which of the following can be used to get the latest results quickly with the least impact on RCU (Read Capacity Unit)?

1 Answer

0 votes
by

Correct Answer - C.

Global Secondary Index does not support Consistent read.

It only supports Eventual Read.

For other tables, Query with Consistent Read will provide the latest results without scanning the whole table.

Option A is incorrect as Global Secondary Index does not support Consistent read.

Option B is incorrect as Scan will impact performance as it will scan the whole table.

Option D is incorrect as Scan will impact performance as it will scan the whole table.

For more information for Query with DynamoDB, refer to the following URL-

https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html

To get the latest results quickly with the least impact on RCU, you should use Query with ConsistentRead.

Query with ConsistentRead returns a strongly consistent result, meaning it returns the most up-to-date data. When you use ConsistentRead, DynamoDB queries all the nodes in the local region to provide a consistent view of the data. This operation requires more RCU than Query with EventualRead, but it returns the most up-to-date data with high accuracy.

On the other hand, Query with EventualRead returns a result with eventual consistency, which means it may not provide the most up-to-date data. When you use EventualRead, DynamoDB queries a subset of nodes in the local region to provide a result, and it may take some time to catch up with the latest data. This operation requires fewer RCU than ConsistentRead, but it may return stale data.

Similarly, Scan with ConsistentRead returns a strongly consistent result, but it scans the entire table and may require a significant amount of RCU. Scan with EventualRead returns a result with eventual consistency and scans the entire table, which is inefficient and requires a significant amount of RCU.

In summary, to get the latest results quickly with the least impact on RCU, you should use Query with ConsistentRead.

...