sravanthi vallepu
sravanthi vallepu

Reputation: 29

Aws Dynamo db performance is slow

For my application I am using free tier aws account I have given 5 read capacity and 5Write capacity(i can’t increase the capacity because they will charge if I increase) to the dynamo db here I am using scan operation. The api is loading in between 10 seconds to 20 seconds.

I have used parallel scan too but the api is loading same time. Is there any alternate service in aws.

click here to see the image

Upvotes: 0

Views: 1379

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269171

It is not a good idea to use a Scan on a NoSQL database.

DynamoDB is optimize for Query requests. The data will come back very quickly, guaranteed (within the allocated Capacity).

However, when using a Scan, the database must read each item from the database and each item consumes a Read Capacity unit. So, if you have a table with 1000 items, a Query on one item would consume one Unit, whereas a Scan would consume 1000 Units.

So, either increase the Capacity Units (and cost) or, best of all, use a Query rather than a Scan. Indexes can also help.

You might need to re-think how you store your data if you always need to do a Scan.

Upvotes: 2

Related Questions