简体   繁体   English

Google 云存储与 aws s3 分段上传的兼容性

[英]Google cloud storage compatibility with aws s3 multipart upload

Okay, I have a working apps that use amazon s3 multipart, they use CreateMultipart, UploadPart and CompleteMultiPart.好的,我有一个使用 amazon s3 multipart 的工作应用程序,它们使用 CreateMultipart、UploadPart 和 CompleteMultiPart。

Now we are migrating to google cloud storage and we have a problem with multipart.现在我们正在迁移到谷歌云存储,我们遇到了多部分的问题。 As far as I understood google doesn't support s3 multipart, got info from here Google Cloud Storage support of S3 multipart upload .据我了解,谷歌不支持 s3 multipart,从这里获得信息Google Cloud Storage support of S3 multipart upload

So I see that google has closest method Compose https://cloud.google.com/storage/docs/composite-objects , where I just upload different objects and then send request to combine them, or I can use uploadType=multipart https://cloud.google.com/storage/docs/json_api/v1/how-tos/upload#resumable , but this seems to be completely different from s3 multipart.所以我看到谷歌有最接近的方法 Compose https://cloud.google.com/storage/docs/composite-objects ,我只是上传不同的对象,然后发送请求来组合它们,或者我可以使用uploadType=multipart https: //cloud.google.com/storage/docs/json_api/v1/how-tos/upload#resumable ,但这似乎与s3 multipart完全不同。 And there is resumable upload https://cloud.google.com/storage/docs/resumable-uploads , that seems to allow upload files in chunks, but without complete multipart.并且有可恢复上传https://cloud.google.com/storage/docs/resumable-uploads ,这似乎允许上传文件块,但没有完整的多部分。

What is the best option to use?最好的选择是什么? Some services already use CreateMultiPart, UploadPart, CompletePart and I need to write "adapter" for this services in order to make them compatible with google cloud storage.一些服务已经使用 CreateMultiPart、UploadPart、CompletePart,我需要为这些服务编写“适配器”,以使它们与谷歌云存储兼容。

Update: below answer is no longer correct .更新:以下答案不再正确 GCS does support multipart uploads: https://cloud.google.com/storage/docs/xml-api/post-object-multipart GCS 确实支持分段上传: https://cloud.google.com/storage/docs/xml-api/post-object-multipart

You are correct.你是对的。 Google Cloud Storage does not currently support multipart upload. Google Cloud Storage 目前不支持分段上传。

The main benefits to multipart upload are allowing multiple streams to upload in parallel from one or more machines and allowing a partial upload failure not to ruin the whole upload.分段上传的主要好处是允许多个流从一台或多台机器并行上传,并且允许部分上传失败不会破坏整个上传。 The best way to get those same benefits with GCS would be to upload the parts as separate objects and then using Compose to combine them into a final object.使用 GCS 获得相同好处的最佳方法是将这些部分作为单独的对象上传,然后使用 Compose 将它们组合成最终的 object。 Indeed, this is exactly what the gsutil command-line utility does when uploading in parallel.事实上,这正是 gsutil 命令行实用程序在并行上传时所做的事情。

Resumable uploads are a great tool if you want to upload a single object in a single stream, in order, and you want the ability to resume if the connection is lost.如果您想按顺序在单个 stream 中上传单个 object,并且您希望能够在连接丢失时恢复,则可恢复上传是一个很好的工具。

"uploadtype=multipart" uploads are a bit different. “uploadtype=multipart”上传有点不同。 They are a way to specify an object's complete metadata and also its data in a single upload operation, using an HTTP multipart request.它们是一种在单个上传操作中指定对象的完整元数据及其数据的方法,使用 HTTP 多部分请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM