Lesson 6 of 16
11. Object / Blob Storage

11.5 How do you upload very large files reliably?

3 min read+10 XP

At the cloakroom: A guest arrives with fifty boxes of wedding gifts. Carrying them all in one trip is impossible, and if they drop the pile at the last step, they start over. Instead, they bring the boxes a few at a time, any order, and if one box falls, they just carry that one again. The attendant stacks them in order at the end.

In the system: Multipart upload splits a large file into parts that are uploaded separately, then joined.

a 5 GB video uploaded in 50 parts; a failed part is retried alone; storage joins parts at the end.

Figure: a dropped connection costs one 100 MB part, not the whole 5 GB.

  1. Start a multipart upload; storage returns an upload ID.
  2. Upload parts (each with a part number), in parallel and in any order. Retry any part that fails.
  3. Complete: storage joins the parts in part-number order into one object.

Why it matters:

  • Reliability: a 5 GB upload over a 20 Mbps connection takes about 33 minutes. Failing at minute 30 without multipart means starting over; with multipart, you redo one part.
  • Speed: parallel parts use more of the connection.
  • Limits: on S3, parts are 5 MiB to 5 GiB, up to 10,000 parts, for objects up to about 48.8 TiB, and AWS recommends multipart for objects of about 100 MB and up.

Clean up unfinished uploads: abandoned parts take space and cost money. A lifecycle rule (11.7) can delete them after a few days.

Memory code: "Many small boxes, any order; drop one, carry one again."