- Newest
- Most votes
- Most comments
The issue you're experiencing with retrieving only a subset of your Project records is likely related to DynamoDB's batch operation limitations and possibly some caching in your Amplify application.
When using batch operations in DynamoDB, there are important constraints to be aware of:
-
BatchGetItem operations have a limit of 100 items per request. If you're trying to retrieve more than 100 items in a single operation, you'll need to implement pagination or multiple requests.
-
There's also a 1 MB size limit for the response. If your response exceeds this size, DynamoDB returns partial results along with an UnprocessedKeys value that you can use to retrieve the remaining items.
-
When the response size limit is exceeded, DynamoDB automatically adjusts the number of items returned per page to enforce this limit. For example, even if you request 100 items but each item is large, the system might return fewer items.
Additionally, Amplify might be caching some part of your build process or query results. This can cause your deployed application to use stale data even when the underlying DynamoDB table has been updated.
To resolve this issue, you could:
-
Implement pagination in your queries to handle large datasets more effectively.
-
Check if you need to clear any caches in your Amplify application. This might involve modifying your build settings (amplify.yml) to temporarily disable caching.
-
Ensure your GraphQL resolvers are properly configured to handle the volume of data you're working with.
-
If you're using a specific retrieval configuration, check if you need to adjust parameters like numberOfResults to ensure all records are returned.
-
Monitor your application for any throttling or capacity-related errors that might indicate you're hitting DynamoDB's provisioned throughput limits.
Sources
DynamoDB AWS SDK SdkIterable taking time to iterate | AWS re:Post
BatchGetItem - Amazon DynamoDB
How do I prevent my deployed amplify app from using a stale/outdated version of my backend? | AWS re:Post
Relevant content
- asked 4 years ago
- AWS OFFICIALUpdated 3 years ago
