DEV Community

Cover image for AWS S3 - Multipart file upload - Surprise Bills
Mohammad Jawad (Kasir) Barati
Mohammad Jawad (Kasir) Barati

Posted on

AWS S3 - Multipart file upload - Surprise Bills

It is super easy to loss sight of AWS's hidden costs or at least somewhat hard to find unless you're a meticulous person who loves reading docs and ain't under deadline pressure where you cannot find the time to even scratch your back πŸ˜‚.

Back to the topic of cost management, so assume you're using the multipart file upload and if you're upload was busted in the middle you're not aborting the whole thing. Here is where things gets interesting, AWS will store those chunk of data for you forever, unless you have configured a life cycle rule or have called their AbortMultipartUpload API.

For more details check out my GitHub repo where you can find other places where you might be incurring cost without knowing it. BTW if this was helpful to you consider giving my repo a star so more people can reach it and learn about these aspects of cloud.

GitHub logo kasir-barati / cloud

It was my endeavour to build a wrapper around Docker and develop a RESTful API. In order to serve Platform as a Service. But now it's a place to learn more about cloud and put things into practice, of course things that are related to this topic.

Important

Keep this file content in sync with index.md.

Cloud

  1. I love to hear your thoughts about the things that I am doing here. So reach out. Or better yet, formulate your thoughts in a GH issue.
  2. Most of the things I am putting in this repo are my own original creation, although I'm not reinventing the wheel when it is out there. So I might have taken some parts of other's creation and modified them to suit my needs. So credits goes still to the original creator of those contents.

Note

Initial codebase: this repo was intended to be a professional RESTful API in time, but it didn't come to fruition. So now you can see my endeavour here.

Be Careful With Your Bills

Learn about some common pitfalls when it comes to cloud and its bills here.

Handwritings

I first started by jotting down on…


BTW you can find me here as well:

Instagram: https://www.instagram.com/node.js.developers.kh/
Facebook: https://www.facebook.com/kasirbarati
X: https://x.com/kasir_barati
YouTube: https://www.youtube.com/@kasir-barati
GitHub: https://github.com/kasir-barati/
Dev.to: https://dev.to/kasir-barati
LinkedIn: https://linkedin.com/in/kasir-barati

Top comments (1)

Collapse
 
scsoi profile image
疏影 •

Surprise-bill stories are gold β€” they save other teams from the same trap. The unfinished-multipart part is the one nobody talks about: a failed upload leaves parts behind, S3 keeps charging for storage, and you don't notice until the bill arrives.
Three patterns I keep returning to:

  • Lifecycle rule on the bucket: expire incomplete multipart uploads after 7 days. Costs nothing to set, fixes the surprise.
  • For uploads from the Windows admin side: skip the API entirely. Mount the bucket as a drive letter and copy-paste. ScsDriver handles S3 alongside SMB / Blob / SFTP / WebDAV β€” for files under ~100MB this is way simpler than wiring up multipart.
  • For files over 100MB: the multipart approach is correct, but use AWS SDK's high-level upload helpers β€” they handle the resume / cleanup logic that hand-rolled multipart usually misses. Operational note: monitor multipart-upload count in CloudWatch. A spike means a deploy started failing partway. Catch it before the bill arrives.