- Newest
- Most votes
- Most comments
AWS SDK v3 for JavaScript/TypeScript does indeed maintain persistent connections by default for most services. This is achieved through connection pooling and keep-alive mechanisms. However, it's important to note that the exact behavior can vary slightly depending on the specific service and the underlying protocol used.
While the general principle of connection reuse applies to most AWS services in SDK v3, there can be some variations:
HTTP/HTTPS Services: Most AWS services that use HTTP/HTTPS (like S3, SNS, SQS, DynamoDB, etc.) benefit from connection reuse.
WebSocket Services: Some services that use WebSocket connections (like IoT) may have different connection management.
Specific Service Behaviors: Some services might have unique connection handling due to their nature or security requirements.
https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html
One thing not covered in the answer above:
Persistent connections are not used across different Lambda invocations - each invocation is a separate execution environment and creates/maintains its own connections to anything on the network (AWS services included).
Relevant content
- asked a year ago
- asked 3 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated a year ago
Where can I find out or how can know If a certain service supports connection pooling or keep-alive mechanisms?