You mean how multipart uploads are implemented? It’s really quite simple, it’s uploaded as multiple (hidden) s3 files, one by one, and then a final “commit” or “merge” which atomically concats all these files into a single final file.
The change here is that now these files are not hidden anymore.
There are probably some optimizations in place, such as ensuring all objects arrive on the exact same node and whatnot, but yeah it’s really simple.
It’s also a bit of a leaky abstraction: if you cancel a multipart upload, all those “hidden” files remain. As such, you need to set an S3 lifecycle rule to clean up all those invisible files periodically.
Thanks. That’s an interesting observation that I didn’t think about. When the user cancel a multiparty upload, why can’t the server simply remove those parts? Is it because they are being read?
Because it’s all distributed, and the server is “simple”, it’s not inherently aware of a client canceling. Well, it could, but then that would make the backend logic (much) more complicated, and you can’t differentiate between a client temporarily disrupted and retrying the upload later vs actually never going to finish, etc.
Basically these types of systems are designed to be simple, because that’s a great way to keep things stable.
The change here is that now these files are not hidden anymore.