DynamoDB vs Sql like database

Viewed 24

I just have a question about dynamoDB vs SQL-like database. I know dynamo DB has GSI that can help query data, but I was wondering how can we consider the performance of the scan operation in dynamoDB compared to a query on SQL-like database? Is there any scenario considers the scan operation is helpful? and for the GSI of dynamoDB, what is the cons of mapping all attributes of the item? is it just using more storage?

any idea would be helpful!

thanks everyone

1 Answers

A scan on DDB is basically equivalent to a full table scan on an relational DB.

For small tables, it's not a big deal. For large tables, in DDB or RDB, it becomes a problem. While a scan in a RDB simply takes more time and perhaps is constrained by server resources, in DDB you're paying for every record read. In addition, you'll have to deal with the fact that DDB will only read 1MB of data at a time.

The only time such a scan might be useful is if you actually need to do something with most (all?) the records read.

Yes, the main downside to projecting all your table attributes to a GSI is extra storage costs and possibly requiring extra capacity on the GSI. The upside would be that you don't have to pay for an extra read on the DDB table to get the data you want.

Related