Efficiently Download Large Files into AWS S3 with Step Functions and Lambda

Efficiently Download Large Files into AWS S3 with Step Functions and Lambda

https://medium.com/@tammura/efficiently-download-large-files-into-aws-s3-with-step-functions-and-lambda-2d33466336bd

Medium membership required.

No go mate.

No you can view it without an account, no membership required

You have a typo in your lambda code on GitHub, “download_cunk”

That’s an interesting infrastructure heavy solution. There probably other options as tweaking s3 SDK client, using powertools s3 streaming (https://docs.powertools.aws.dev/lambda/python/latest/utilities/streaming/#streaming-from-a-s3-object), or use mount point (https://github.com/awslabs/mountpoint-s3).

Just dropping few options for folks who have similar problem, but don’t want to use stepfinctions.

Thanks i’ll fix it

Just click the X, lol

Er…why not just use rclone one an ec2 instance?

Pretty sure lambdas have a 15 minute max execution time.

In my case i was searching for pulling a file from an esternalità sftp, how can i do it using rclone?

Yes lambdas has a 15 minute max execution time, but using step function and this architecture u are sure to not exceed this time ever

https://github.com/aws-samples/file-transfer-sync-solution

rclone copy sftp: s3: -P

Set each command u can further optmise how large packet you want to set n stuff

Set your own settings for each remote with rclone config and new remote thing. Good luck rest gpt is your friend

Just use EC2.

Juniors writing blogs is the worst.

Lambda is also 10x more expensive

I like how precise your statement is. It is highly depends on so many factors. It’s not about which one is better, both can be best and worst solutions under specific circumstances.

Lambda is 10x more expensive than what?

Step functions should always be the last-resort option. They are unbelievably expensive for what they do and are not all that difficult to replicate in other ways. Don’t get me wrong, in specific circumstances they are useful, but it’s not something you ever should promote as an architecture for the masses… unless you work for AWS.

It’s a fun little experiment. I’m not seeing a use case I’m going to be using this for though.

Than letting your files static in S3 apparently.

Start and stop EC2 when needed is the worst. Learn robuse lambda and you will save aome bucks.

Avoid downloading the entire large file using a single Lambda function. Instead, use the “HeadObject” operation to determine the file size and initiate a swarm of Lambdas, each responsible for reading a small portion of the file. Connect with SQS, use step functions to read it sequencially.