Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.

 help



Thanks, oh that’s simpler than I thought. I thought it’s something embedded in the filesystem.

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.


Gotcha, thanks. Yeah it makes sense to simplify the logic for distributed system.

It's conceptually simple but at S3's scale, everything that can go wrong does go wrong.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: