#✅ - Does Datastore.query Use Scan or Query Operation in DynamoDB?

5 messages · Page 1 of 1 (latest)

brisk beacon
#

I'm using Datastore.query for my Amplify project and need to understand if it uses the Scan or Query operation.

This is important because:

Query: Efficient, uses RCUs based on matched items, and is cost-effective.
Scan: Scans the entire table, leading to high RCU usage and costs that rise with table size.

If Datastore.query relies on Scan, costs will skyrocket as the table grows. Knowing which operation it uses is crucial for managing performance and expenses.

Any insights or experiences with this or how we can effectively reduce DynamoDb costs would be helpful!

hushed tangle
#

DataStore.query doesn’t interface with DynamoDB at all actually. It performs a query on the device’s storage. DynamoDB scans only happen when a sync occurs and those can be made to perform queries by using sync expressions that map to a query expression.

brisk beacon
hushed tangle
#

That’s correct!

iron furnaceBOT
#

✅ - Does Datastore.query Use Scan or Query Operation in DynamoDB?