Question: Can DynamoDB do aggregations?
Answered by Rafal Wilinski
Answer
A simple answer is that DynamoDB does not support aggregations. Since DynamoDB is a NoSQL database and it has very limited query functionality. So it is impossible to perform aggregation from a DynamoDB table by directly calling the DynamoDB API.
But there are a few tools and techniques to achieve the aggregations:
- Perform a table scan and apply the logic on the application side to do the aggregation functions. But this is not a practical solution for the larger dataset.
- Use a materialized index on DynamoDB. The maximum number of entries could be stored in a separate table and updated as new records are added if your table is write-only and does not allow changes or deletions. This strategy isn't a universal fix, although it can work in some limited situations.
- Use Amazon Redshift to perform analytics.
- Utilize DynamoDB streams to perform data aggregation asynchronously and query an aggregated table to retrieve the aggregated data.
Other Common DynamoDB FAQ (with Answers)
- Why is DynamoDB easy to partition?
- Can QuickSight read DynamoDB?
- Can DynamoDB table have adhoc attributes?
- Can DynamoDB have duplicates?
- Does DynamoDB charge for storage?
- Can we pass objects as an item in DynamoDB?
- How to access DynamoDB from EC2?
- Is DynamoDB expensive?
- Can a DynamoDB range key be a GSI key?
- Is DynamoDB columnar database?
- How to write a test case for mocking DynamoDB?
- What does DynamoDB support?
- Can DynamoDB have multiple tables?
- How to dump multiple DynamoDB tables?
- Do I need a middleware for DynamoDB?
Spend less time in the AWS console, use Dynobase.
Start your 7-day free trial today
Product Features
DynamoDB Tools
DynamoDB Info
© 2024 Dynobase