aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
2.96k stars 556 forks source link

Add support for multipart download for S3 Transfer Manager #5934

Open RanVaknin opened 3 months ago

RanVaknin commented 3 months ago

Describe the feature

Currently the JS SDK transfer manager package (@aws-sdk/lib-storage) only supports an upload function (based on PutObject). Ideally we should add support for an download functionality that can take advantage of the range option in getObject to achieve mutlipart functionality.

Use Case

This feature is crucial for applications that need to download large files or datasets from S3. Currently, developers must implement custom solutions to handle large file downloads, which can be error-prone and inefficient. Having a built-in download manager would simplify this process, making it more reliable and performant.

Proposed Solution

Use the existing design and functionality of the Go SDK v2 download manager as a reference. Implement a similar Downloader class in the JS SDK that supports multipart downloads, concurrency, error handling, and retry mechanisms. The downloader should allow configuring part size, concurrency level, and retry counts.

Other Information

No response

Acknowledgements

SDK version used

N/A

Environment details (OS name and version, etc.)

N/A

giovanni-bertoncelli commented 3 months ago

That would be a great functionality! The new Download class should probably wrap this implementation: https://docs.aws.amazon.com/AmazonS3/latest/userguide/example_s3_Scenario_UsingLargeFiles_section.html (at download large files)?