How to choose multipart transfer and safely complete large object uploads
Multipart upload sends a large file in separate parts and assembles it into one object after the parts arrive. It can resume after network failures without resending successful parts and can transfer parts in parallel, but the client must manage part sizing and upload state, and unfinished parts can incur storage charges. Choose between single-request, multipart, and resumable upload based on file size, connection reliability, memory and bandwidth limits, and recovery needs. This article explains AWS S3 multipart upload and distinguishes the corresponding approaches in Google Cloud Storage and Azure Blob Storage.
How to choose multipart transfer and safely complete large object uploads
Multipart upload sends a large file in separate parts and assembles it into one object after the parts arrive. It can resume after network failures without resending successful parts and can transfer parts in parallel, but the client must manage part sizing and upload state, and unfinished parts can incur storage charges. Choose between single-request, multipart, and resumable upload based on file size, connection reliability, memory and bandwidth limits, and recovery needs. This article explains AWS S3 multipart upload and distinguishes the corresponding approaches in Google Cloud Storage and Azure Blob Storage.
How do parts become one object?
The client initiates an upload and receives a unique upload ID, divides the file into numbered parts, uploads them, then sends a completion request with the successful part information. Parts can be sent independently and in parallel; a failed part can be retried without restarting the whole file. In S3, completion assembles the parts in order. Sending every part is not enough: until the completion request succeeds, the final object has not been created. The upload ID, part numbers, and returned ETags are needed to complete an S3 upload. (Amazon S3 multipart overview)
This changes failure recovery. If a 40 GB file fails near the end of one single-request transfer, the client may have to resend the entire file. If the same file were divided into hypothetical 256 MB parts, only failed parts would need another attempt. These are illustrative numbers, not a recommended part size. Very small parts increase request and bookkeeping overhead; very large parts increase the data to retry and the buffering memory required.
When should you choose multipart upload?
A single request can be simpler for small files on reliable connections when restarting is inexpensive. Multipart or resumable transfer is useful for large files, unreliable networks, or workloads that benefit from parallel throughput. AWS suggests considering multipart upload for objects around 100 MB or larger; this is AWS guidance, not a universal threshold for every service or application. Decide using the file-size distribution, available bandwidth, acceptable retry time, and request costs in your environment. (AWS upload methods and size considerations, S3 multipart overview)
More parallel parts can use bandwidth better, but also consume memory, sockets, and CPU. For a server handling several large uploads at once, consider total concurrent memory before tuning one upload for peak speed. Tune part size and concurrency together, and monitor throughput, retries, memory, throttling responses, and request charges.
What state and checks are needed to resume and verify an upload?
Persist the upload ID or session URI, part numbers or byte ranges, successful responses, and completion state with the application’s upload-job identifier. After a restart, reconcile local state with the server’s reported progress or part list. Confirm that each part was persisted successfully, then verify the final object with a checksum supported by the service.
Amazon S3 can validate a supplied full-object checksum on the server. An ETag for a multipart object cannot generally be treated as the MD5 hash of the complete object. Check the current checksum requirements for the selected upload; for example, S3 imposes part-number requirements when checksums are used. (Amazon S3 multipart checksums)
Concurrent uploads to the same object key can cause unexpected replacement or version outcomes. In versioned S3 buckets, each successful multipart completion creates a new version, and concurrent upload ordering can affect which is current. Consider unique temporary keys followed by validation and promotion, or use conditional writes and application-level coordination to prevent collisions. (Amazon S3 concurrent multipart uploads)
Why do unfinished uploads remain, and how should they be cleaned up?
If a client stops or completion fails, uploaded parts can remain without a final object. S3 can charge for the storage, bandwidth, and requests associated with parts until the upload is completed or aborted. Complete successful uploads, explicitly abort abandoned ones, and consider a bucket lifecycle rule that aborts incomplete multipart uploads after a chosen period. (S3 multipart pricing and abort, S3 lifecycle cleanup for incomplete uploads)
Monitor the number and age of incomplete uploads, failure causes, and part storage. A cleanup period that is too short could stop a valid slow or paused upload. Choose the period to match retry windows and user needs, and confirm the rule targets incomplete parts. This is distinct from a normal expiration rule that deletes completed objects.
How do AWS, Google Cloud, and Azure differ?
“Multipart” does not name the same protocol in every cloud. S3 uses an upload ID to manage parts and a completion request to assemble the object. Google Cloud Storage generally recommends resumable uploads for large transfers. It also has XML API multipart uploads, but these are different from a single-request multipart format in its JSON API. The XML API method is compatible with S3 multipart, assembles parts on completion, and can leave unfinished parts stored until cleaned up. (Google Cloud upload options, XML API multipart uploads, resumable uploads)
Azure Blob Storage’s block blob approach uploads blocks with Put Block, then commits them with Put Block List. A client library may choose one Put Blob request or multiple block requests based on object size and transfer settings. Uncommitted blocks do not appear in normal blob reads and are eventually removed if not committed. Azure client libraries do not support concurrent writes to the same blob, so applications with multiple writers need a concurrency strategy. (Azure Blob upload overview, Azure Put Block API)
Before implementing low-level APIs, check whether the provider’s high-level SDK already handles chunking, retries, completion, and cleanup. Still verify checksums, overwrite and version behavior, permissions, and abandoned-upload costs in your application; an SDK does not automatically resolve every operational choice.
What should you check before choosing an upload method?
Consider not only file size and connection quality, but also acceptable retry time, concurrent uploads, client memory, checksum validation, overwrite protection, permissions, and cleanup. Splitting one large transfer helps recovery and parallelism; it does not combine many small files or provide partial updates to an existing object. Test representative file sizes and confirm the final object’s bytes and metadata, resume behavior, and cleanup after failure before expanding the rollout.
Official documentation
[Amazon S3 multipart upload overview](https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html)
[Amazon S3 upload methods](https://docs.aws.amazon.com/AmazonS3/latest/userguide/upload-objects.html)
[Clean up incomplete Amazon S3 multipart uploads](https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpu-abort-incomplete-mpu-lifecycle-config.html)
[Google Cloud object upload methods](https://docs.cloud.google.com/storage/docs/uploads)
[Google Cloud resumable uploads](https://docs.cloud.google.com/storage/docs/resumable-uploads)
[Google Cloud XML API multipart uploads](https://docs.cloud.google.com/storage/docs/multipart-uploads)
[Upload blobs to Azure Storage](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-upload)
[Azure Put Block API](https://learn.microsoft.com/en-us/rest/api/storageservices/put-block)