Asking for Guidance

0

I have started exploring the possibilities of DynamoDB.
I'm building an application which includes the need of listing all Items. I've read that scans are expensive operations at DynamoDB and I understand this. My question is that, then how should we list all items to "do it in the dynamo way"?

My example:
Let's say I have 800 items, each of them 0.5KB. That's 400KB. That means 100 RCUs if I understood correctly. Which costs $36.60 / year in Frankfurt. This price is not bad, but what if I had 8000 items? I'm sure there's a better way to do this.

Best,
Markus

質問済み 5年前191ビュー
1回答
0
承認された回答

Hello Markus,

If you have a requirement to list all items in DynamoDB, scan is the correct approach to proceed. You could also consider caching the list if there aren't frequent changes to your data.

Scan is expensive as compared to Query or GetItem operations because it reads the entire table, as opposed to Query/GetItem which only reads data pertaining to a specific partition key.

We recommend using Query rather than Scan only in case the partition key's value is known. You could draw an analogy in terms of MySQL as follows:
running select * with a where clause = query
running select * = scan

I hope this helps address your question.

AWS
回答済み 5年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ