DEV Community

Cover image for AWS S3 Multipart : Part 1 Introduction
Mitansh Gor for Distinction Dev

Posted on • Edited on

AWS S3 Multipart : Part 1 Introduction

Hey there, fellow data adventurers! 🌟 Let me whisk you away on a thrilling journey into the incredible world of multipart upload—a true superhero in the realm of data management! 💥

sheldon

My Journey:

Imagine this: I stood face to face with colossal data mountains—CSV files nestled in an S3 bucket. My quest? To read them, transform their essence, merge their tales, and guide them back to their digital abode.

pile of files

Approach 1: Picture me, utilizing S3 readStreams, reading file chunks in parallel, all to piece together a massive string for a swift return to S3. But alas! My valiant efforts met an unexpected foe—the string limit!(9,007,199,254,740,991 (2⁵³-1) characters) It abruptly halted my progress, leaving my data adventure in disarray.

Approach 2: Enter the game-changer—multipart upload! This genius approach not only banished the string limit issue but also slashed memory usage. It transformed my journey, enhancing speed and performance in handling and manipulating vast data! 🚀✨

Welcome to the world of multipart upload, where your colossal data finds new life in manageable parts—each one a hero in its own right! 🦸‍♂️✂️ Upload them at will, in any order! If one gets jittery and fumbles on its journey, no sweat! Send it back without spoiling the whole party. 🎉🔄

Then comes the grand finale! Amazon S3 swoops in like a leader, uniting these brave parts into the original, magnificent object. Ta-da! 🦸‍♂️✨


🌟Multipart upload unfolds a captivating three-step process for your data! : You kickstart the upload, then you proceed to upload the object parts, and once all the parts are in place, you wrap up the multipart upload. 🚀📦

Multipart Upload Initiation

It all begins with the initiation - sending that golden request to start your multipart upload. 📧 Amazon S3, our gracious host, responds with an exclusive upload ID, like a backstage pass to your data concert. 🎫💽 Remember, this upload ID is your VIP ticket; it's crucial for all future interactions with your upload party.

get started

Uploading Parts - The 'Part-y' Begins

Now, onto the fun part - uploading those object parts! Each part gets its unique number, sort of like giving your data a ticket with a seat number in the cosmic theater. 🎭🎟️ You've got a range of numbers to choose from, 1 through 10,000 - go wild! And guess what? You don't have to follow a sequence; it's like a puzzle where every piece finds its place, even if it's out of order. 🧩

avengers assemble

Just a heads up - if you upload a new part using the same number as a previous one, it's like hitting 'overwrite' on your old data. Be cautious with that power! 💥💾

The Grande Finale - Completing the Multipart Upload

🌟 Lights, Camera, Action - it's finale time! When the curtain falls on your multipart upload, Amazon S3 takes a bow, crafting a magnificent object. How? By neatly piecing together uploaded parts in order—like a puzzle forming, piece by piece! 🧩✨

Behind the scenes: Start a multipart upload, send those parts on an adventure, and now, the big decision! Hit "complete" or halt the show. Why? That's when billing for storing parts stops. Money talk! 💸💰

money

Here's the deal: Only after completion or stopping, Amazon S3 frees its hold on parts' storage—no more charges! It's like clearing the stage after the show—gotta be done! 🎭🚫💼

But if you hit "stop" midway? That's a wrap! No more uploading with that ID. The show's over. Some parts might wrap up or flub their dance after your call. Ensure all parts bow out before stopping for a tidy storage exit. 🎬🎶

Example

Alright, imagine you're about to upload a massive 100 GB file using multipart upload.

Step 1: The CreateMultipartUpload call kicks things off—kind of like saying, "Let the show begin!"

Step 2: Here's where the real action happens! We've got 1000 individual UploadPart calls, each flexing its muscles by handling a 100 MB part of that hefty 100 GB file. It's like breaking down the big act into smaller, more manageable dance routines. 🎶💃

Step 1002: The grand finale! The CompleteMultipartUpload call wraps up the show, tying all those amazing parts together into one spectacular performance! 🌟✨

And just like that, in a whirlwind of 1002 API calls, your colossal 100 GB file finds its way gracefully into the cloud! 🚀🌈

multipart example image


Why join this multipart upload bonanza?

  • Speed, my friends! Upload parts simultaneously and witness your data fly into the cloud faster than a superhero chasing villains! 🚀💨
  • And hold on tight! If network gremlins try to play spoilsport, fear not! Smaller parts mean a hiccup won't spoil the show—it's your data's safety net. 🛡️🌐
  • Pause, resume—no deadlines! Start the multipart shindig; it's all under your command! ⏸️⏩
  • The cherry on top? Begin the adventure without knowing the object's full size—talk about thrilling! 🌍 🎉

Pro tips for the multipart madness:

  • High-speed network? Dive into multipart upload for multi-lane data speedways! 🚗🚗🚗
  • Moody internet? Multipart uploads your shield! No need to restart; just focus on the parts that need a little extra love. 🌐
  • Oh, and by the way, check out these multipart upload core specifications:

    Item Specification
    Maximum object size 5 TiB
    Maximum number of parts per upload 10,000
    Part Numbers 1 to 10,000 (inclusive)
    Part size 5 MiB to 5 GiB.

When life gives you lemonades (large data), make lemons (make small part and use multipart), leaving life scratching its head and saying, "Wait, what?" 🍋📦🚀

phil dunphy

There you have it, amigos! Here's your high-flying, turbo-charged glimpse into the fantastic world of multipart upload—a sneak peek before we dive deeper into the data abyss! 🌟🚀

In this session, we've just scratched the surface, giving you a sneak peek into how multipart upload works. Picture it: splitting your data into smaller heroes, sending them off to the cloud, and reuniting them in a grand spectacle! 🦸‍♂️🌐

Stay tuned for the next blog where we'll dive deeper! We'll chat about the nitty-gritty, the low-level design, and even share some code snippets. It's like unlocking the secret codes to the data universe! 📜💻

So, until our paths cross again in the blogosphere, stay safe, keep rocking those data adventures, and never stop the quest for learning! 🛡️🎸📚

Catch you later, Until then—adieu! 👋🌟


References:

Top comments (0)