You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Buckets and objects are the two fundamental resources in Cloud Storage. A bucket is a container that holds objects, and an object is an immutable blob of data (a file) with associated metadata. Understanding how to create, configure, and manage buckets and objects is essential for effective use of Cloud Storage.
A bucket is a top-level container for objects. Every object must reside in a bucket.
| Location Type | Example | Description |
|---|---|---|
| Region | europe-west2 | Single data centre location — lowest latency, lowest cost |
| Dual-region | eur4 (Finland + Netherlands) | Two specific regions — higher availability |
| Multi-region | EU, US, ASIA | Multiple data centres across a large geographic area — highest availability |
The location is set at bucket creation time and cannot be changed afterwards.
# Create a regional bucket
gsutil mb -l europe-west2 -c standard gs://my-regional-bucket
# Create a multi-region bucket
gsutil mb -l EU -c standard gs://my-eu-bucket
# Create a dual-region bucket
gsutil mb -l eur4 -c nearline gs://my-dual-region-bucket
# Using gcloud storage
gcloud storage buckets create gs://my-bucket \
--location=europe-west2 \
--default-storage-class=standard \
--uniform-bucket-level-access
| Setting | Description |
|---|---|
| Default storage class | Applied to new objects unless overridden |
| Uniform bucket-level access | Uses IAM only (recommended); disables ACLs |
| Public access prevention | Blocks allUsers/allAuthenticatedUsers grants |
| Versioning | Preserves non-current versions of overwritten/deleted objects |
| Retention policy | Prevents deletion until a minimum retention period expires |
| Labels | Key-value pairs for cost tracking and organisation |
| Autoclass | Automatically transitions objects between storage classes |
Objects are the individual data items stored in buckets. Each object consists of:
| Component | Description |
|---|---|
| Object data | The file content (binary or text) |
| Object name (key) | The unique identifier within the bucket (e.g., images/photo.jpg) |
| Generation number | A unique version ID that changes each time the object is overwritten |
| Metageneration | Tracks metadata-only changes |
| Metadata | System and custom key-value pairs |
Cloud Storage has a flat namespace — there are no real directories. Forward slashes in object names simulate a directory structure:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.