- Newest
- Most votes
- Most comments
I figured it out. I was hitting the wrong AWS account. But what through me for a loop was there was data in the tables so I thought for sure I'm hitting the correct account. But I am using Dynamoose to talk to Dynamo. And I just found out that Dynamoose will automatically create the tables if they don't exist by default. So running locally it was creating tables in a different AWS account than I thought I was using
answered a year ago
Based on the information provided, there are a few potential explanations for the discrepancy you're experiencing between the AWS console and the SDK results:
-
Eventual Consistency: DynamoDB uses an eventually consistent read model by default. This means that the most recent write operation might not be reflected immediately when you read the data. It's possible that you're seeing an older version of the data through the SDK. To ensure you're getting the most up-to-date data, you can use a strongly consistent read in your SDK call.
-
Caching: Some SDKs or applications might implement caching mechanisms. Ensure that you're not inadvertently caching old data in your application.
-
Global Tables: If you're using DynamoDB Global Tables, it's possible that replication lag is causing the discrepancy. Check if you're querying the same region in both the console and your SDK calls.
-
Incorrect Query Parameters: Double-check that your SDK query is using the correct partition key and sort key values. A small typo could lead to unexpected results.
-
SDK Version: Ensure you're using the latest version of the AWS SDK. Older versions might have bugs or inconsistencies that have been fixed in newer releases.
-
Table Name: Verify that you're querying the correct table name in your SDK call. It's easy to accidentally query a development or test table instead of the production one.
To troubleshoot this issue:
- Use a strongly consistent read in your SDK call to ensure you're getting the most up-to-date data.
- Double-check all query parameters, especially the partition key and sort key values.
- Try clearing any application-level caches.
- Use the AWS CLI to query the table and compare the results with both the console and your SDK call.
- Check the CloudTrail logs to see if there have been any recent write operations on the table that might explain the discrepancy.
If the issue persists after trying these steps, you may want to contact AWS support for further assistance, as there could be an underlying issue with the table or the SDK.
Sources
Work with items in DynamoDB - AWS SDK for Java 2.x
answered a year ago
Relevant content
asked 2 years ago

I was going to ask this when I came across the question. Glad you solved it