- Newest
- Most votes
- Most comments
Based on the information provided, it seems unlikely that the issue is related to region mismatch, credentials, or the table not existing, especially since restarting the app servers temporarily resolves the problem. The intermittent nature of the issue and its resolution through restarts suggest a different underlying cause.
One possibility to consider is that your application might be experiencing connection issues with DynamoDB. This could be due to network instability, connection pool exhaustion, or improper handling of DynamoDB client connections.
Here are a few suggestions to investigate and potentially resolve the issue:
-
Connection pooling: Ensure you're using proper connection pooling with the DynamoDB client. Creating a new client for each request can lead to resource exhaustion.
-
Error handling and retries: Implement robust error handling and retry mechanisms in your application. The AWS SDK for Node.js has built-in retry capabilities that you should leverage.
-
Timeouts: Check if you have appropriate timeout settings for your DynamoDB operations. Long-running queries might be timing out.
-
Monitoring: Set up detailed monitoring for your Elastic Beanstalk environment and DynamoDB tables. This can help identify resource constraints or performance issues.
-
SDK version: Ensure you're using the latest version of the AWS SDK for Node.js. Older versions might have bugs that could cause intermittent connection issues.
-
VPC configuration: If your Elastic Beanstalk environment is in a VPC, verify that the network configuration allows proper communication with DynamoDB.
Regarding your concern about logging, while excessive logging can impact performance, it's unlikely to directly cause the specific "ResourceNotFoundException" error you're seeing. However, reducing verbose logging is generally a good practice for improving overall application performance.
To further diagnose the issue, you might want to implement more targeted logging around your DynamoDB operations, focusing on connection establishment and error cases. This could help identify patterns or specific conditions that lead to the connection losses.
If the problem persists after implementing these suggestions, you may want to consider reaching out to AWS support for more in-depth investigation, as there could be underlying infrastructure or service-specific issues at play.
Sources
Migrating to DAX Node.js SDK V3 - Amazon DynamoDB
Deploying a Node.js application with DynamoDB to Elastic Beanstalk - AWS Elastic Beanstalk
