Does Amazon S3 support multi-file atomic uploads?
I'm dev开发者_如何学Goeloping a system against Amazon's S3. I'm doing it in C# using S3's .NET SDK.
I want to upload several files to S3 at once but if any one fails I want all of them to fail. Can I do this? How?
Does the SDK's TransferUtility.UploadDirectory do an atomic upload of the directory, where if any file in the directory fails to upload then they all fail?
If it doesn't do atomic uploads then I'll need to have code to manage it myself; how do I learn about what files succeeded and which failed using the TransferUtility.UploadDirectory?
Thanks for any help or direction pointing.
Well, it seems as though the TransferUtility methods are fairly high level helper type methods that provide little feedback, and UploadDirectory does not incorporate any atomicity logic (nor does S3 for multiple files, which is what would really need to happen for good atomicity).
So, some type of eventual consistency queues are needed to make sure things get done instead. A multi-file upload mechanism for S3 to treat atomically would be very handy, and maybe they're working on it, but they don't seem to have this feature currently.
No, you can't do this. S3 does not offer any API for multi-object uploads. The best you can do is to implement this in your client (if one upload fails, remove all objects that have already been uploaded), but of course that's not atomic.
精彩评论