为什么 S3 和 Google Storage 存储桶将命名为全局命名空间? [英] Why are S3 and Google Storage bucket names a global namespace?

查看:23
本文介绍了为什么 S3 和 Google Storage 存储桶将命名为全局命名空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这让我很困惑.我显然可以理解为什么帐户 ID 是全局的,但为什么是存储桶名称?

This has me puzzled. I can obviously understand why account ID's are global, but why bucket names?

使用类似以下内容是否更有意义:https://accountID.storageservice.com/bucketName

Wouldn't it make more sense to have something like: https://accountID.storageservice.com/bucketName

accountID 下的命名空间存储区.

Which would namespace buckets under accountID.

我错过了什么,为什么这些明显的精英建筑师选择以这种方式处理存储桶名称?

What am I missing, why did these obviously elite architects choose to handle bucket names this way?

推荐答案

bucket 命名空间是全局的——就像域名一样"

"The bucket namespace is global - just like domain names"

http://aws.amazon.com/articles/1109#02

这不仅仅是巧合.

原因似乎很简单:可以通过与存储桶名称相同的自定义主机名访问存储桶及其对象......并且存储桶可以可选地托管整个静态网站 -- S3 自动映射来自传入 Host 的请求: header 到同名的bucket上.

The reason seems simple enough: buckets and their objects can be accessed through a custom hostname that's the same as the bucket name... and a bucket can optionally host an entire static web site -- with S3 automatically mapping requests from the incoming Host: header onto the bucket of the same name.

在 S3 中,这些变体 URL 引用相同的对象foo.txt";在存储桶bucket.example.com"中.第一个适用于启用静态网站托管,并且需要 DNS CNAME(或 Route 53 中的 Alias)或指向区域 REST 端点的 DNS CNAME;其他不需要配置:

In S3, these variant URLs reference the same object "foo.txt" in the bucket "bucket.example.com". The first one works with static website hosting enabled and requires a DNS CNAME (or Alias in Route 53) or a DNS CNAME pointing to the regional REST endpoint; the others require no configuration:

http://bucket.example.com/foo.txt
http://bucket.example.com.s3.amazonaws.com/foo.txt
http://bucket.example.com.s3[-region].amazonaws.com/foo.txt
http://s3[-region].amazonaws.com/bucket.example.com/foo.txt   

如果对象存储服务需要一种简单的机制来将 HTTP 传入请求中的 Host: 标头解析为存储桶名称,则存储桶名称命名空间也需要是全局的.其他任何事情似乎都会使实施显着复杂化.

If an object store service needs a simple mechanism to resolve the Host: header in an HTTP incoming request into a bucket name, the bucket name namespace also needs to be global. Anything else, it seems, would complicate the implementation significantly.

对于可映射到存储桶名称的主机名,某事 必须是全局唯一的,因为显然没有两个存储桶可以响应相同的主机名.应用于存储桶名称本身的限制不会产生歧义.

For hostnames to be mappable to bucket names, something has to be globally unique, since obviously no two buckets could respond to the same hostname. The restriction being applied to the bucket name itself leaves no room for ambiguity.

许多潜在客户似乎也不希望在存储桶名称中标识他们的帐户.

It also seems likely that many potential clients wouldn't like to have their account identified in bucket names.

当然,您始终可以将您的帐户 ID 或任何随机字符串添加到您想要的存储桶名称中,例如jozxyqk-payroll、jozxyqk-personnel,如果您想要的存储桶名称不可用.

Of course, you could always add your account id, or any random string, to your desired bucket name, e.g. jozxyqk-payroll, jozxyqk-personnel, if the bucket name you wanted wasn't available.

这篇关于为什么 S3 和 Google Storage 存储桶将命名为全局命名空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆