7

Question

When Google Cloud Storage says that all GCS Buckets share a common namespace (paragraph 2 here)

When you create a bucket, you specify a globally-unique name, a geographic location where the bucket and its contents are stored, and a default storage class. The default storage class you choose applies to objects added to the bucket that don't have a storage class specified explicitly.

and (bullet 1 here)

Bucket names reside in a single Cloud Storage namespace.

This means that:

Every bucket name must be unique. Bucket names are publicly visible. If you try to create a bucket with a name that already belongs to an existing bucket, Cloud Storage responds with an error message. However, once you delete a bucket, you or another user can reuse its name for a new bucket. The time it takes a deleted bucket's name to become available again is typically on the order of seconds; however, if you delete the project that contains the bucket, which effectively deletes the bucket as well, the bucket name may not be released for weeks or longer.

does "single namespace" and "globally" literally mean that across the entire Google Cloud regardless of your organization, project, or region you cannot create any bucket that shares a name with another bucket anywhere else on the entire planet for all existing buckets at any given time?

I have only ever worked on GCP within one organization, and we prefix our buckets with the organization name lots of times but also sometimes we don't. I am not concerned with running out of names or anything like that, I am more just curious what is meant by those things "globally" and "single namespace" and if it means what I think it does.

Given that most times buckets are only referenced by their name with the gs:// prefix I can see how having literal global uniqueness is important for ensuring consistent access experiences without needing to know things like project/organization IDs. Can anybody find a source that confirms this?

Odd Implication/thought experiment

If this is the case something I do wonder given...

  1. There appears to be no cost associated to creating an empty bucket you do not use up to 5k buckets a month, more than that is $0.05 per 10k buckets (source)
  2. There is no limit to the number of buckets you can create in a project (source)

... what is to stop me from creating a free-tier project(s), and iterating over ALL possible GCS bucket names (obviously it would take forever and be quite impractical) but in theory just occupying all bucket names (or at least all human readable ones) and selling those names to individuals who wish to purchase them for their organization if the bucket name does not already exist? I suppose the number of possibilities is astronomical meaning even at $0.05, for it to be profitable one would need to know the ratio of names that will be bought to the list of available ones to determine rational pricing, and even at $0.05 per 10k (with the first 5k a month being free) there is not enough money in the world to create all of the buckets at once. Still, I think about these things.

2
  • 1
    Google's approach (which in fairness might be similar to other cloud providers) seems like a security problem waiting to happen. They do add a warning when you are creating a bucket, but users may not appreciate the extent of the problem because, to them, the bucket looks safely stored within just their project. People may not realize it is a global namespace.
    – Stephen
    Commented Sep 26, 2022 at 21:19
  • It seems like this problem could be solved by giving the option to use paths like gs://org_name/bucket_name or gs://org_name/project_name/bucket_name, since users from other organizations could be prevented from scanning those bucket names.
    – Stephen
    Commented Sep 26, 2022 at 21:19

1 Answer 1

16

Yes, "single namespace" and "globally" mean what you said: All GCS buckets must have unique names, regardless of organization, project, and region.

2
  • 1
    Based on your past work experience, I will accept this as truth. Thanks for the quick reply! Commented Aug 14, 2020 at 18:42
  • I work in multiple projects owned by multiple businesses, that I own. I can confirm the above to be exactly true. Commented Dec 15, 2022 at 13:10

Not the answer you're looking for? Browse other questions tagged or ask your own question.