Bucket Naming and Namespaces
What you'll learn: How to name buckets correctly and why bucket names must be globally unique across all users in a cloud provider.
Why Bucket Names Are Global
Unlike VM names (which only need to be unique within your account), bucket names must be globally unique across the entire cloud provider. Think of it like domain names on the internet—no two websites can have exactly the same domain, and no two buckets can share the same name, even if owned by different customers.
This global uniqueness exists because bucket names often become part of public URLs. For example, a bucket named my-data might be accessed at https://my-data.s3.amazonaws.com. If two people could create my-data, the system wouldn't know which bucket to route requests to.
Naming Rules and DNS Compatibility
Bucket names must follow DNS-compatible naming conventions:
- Use only lowercase letters, numbers, hyphens, and periods
- Must start and end with a letter or number (no leading/trailing hyphens)
- Length typically between 3-63 characters
- No underscores, spaces, or special characters
- Avoid uppercase letters (they're either forbidden or converted to lowercase)
Good examples:
my-company-backups-2024user.photos.archiveapp-logs-production
Bad examples:
My_Bucket(uppercase and underscore)bucket-name-(trailing hyphen)ab(too short)
Best Practices
Use prefixes that include your company name or unique identifier to avoid naming conflicts. Since the namespace is shared globally, generic names like backups or images are likely already taken.
Key Takeaway: Bucket names must be globally unique and DNS-compatible—choose descriptive, lowercase names with hyphens, and include unique prefixes to avoid conflicts with other users worldwide.