Ali Abbas
Ali Abbas

Reputation: 488

Scan Vs BatchGetItems in Dynamo-db

If I know the primary key of the items, Which approach is best approach

Please recommend the solution in terms of both latency and partitions impact.

Upvotes: 1

Views: 267

Answers (1)

Rik
Rik

Reputation: 29243

Probably neither. Of course it all depends on the key schema and the data in the table, but you probably want to create an Global Secondary Index for your most frequently used queries.

Having said that; performing scans is highly discouraged, especially when working with large volumes of data. So if you know the primary key of the items you're interested in, go for BatchGetItems over doing a scan.

Upvotes: 2

Related Questions