Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Why Cloud Storage matters for object data
📖 Scenario: You work for a small company that wants to store and manage photos and videos from customers. These files are large and come in many formats. You need a simple, reliable way to keep these files safe and easy to access from anywhere.
🎯 Goal: Build a basic Google Cloud Storage setup that organizes object data into buckets and sets access permissions. This will help the company store and manage their files securely and efficiently.
📋 What You'll Learn
Create a Cloud Storage bucket named exactly customer-media-bucket
Set a location for the bucket as US
Define a variable storage_class with the value STANDARD
Use the storage_class variable when creating the bucket
Add a lifecycle rule to delete objects older than 365 days
Enable uniform bucket-level access for security
💡 Why This Matters
🌍 Real World
Cloud Storage is used by companies to store large files like photos, videos, backups, and logs. It makes data accessible from anywhere and protects it with security and lifecycle rules.
💼 Career
Knowing how to configure Cloud Storage buckets is essential for cloud engineers and developers managing data storage, backups, and compliance in cloud environments.
Progress0 / 4 steps
1
Create the Cloud Storage bucket
Write code to create a Cloud Storage bucket named customer-media-bucket in the US location. Use the Google Cloud Python client library and assign the bucket to a variable called bucket.
GCP
Hint
Use client.bucket('customer-media-bucket') to create the bucket object and set bucket.location = 'US'.
2
Define the storage class variable
Create a variable called storage_class and set it to the string 'STANDARD'. This will specify the storage class for the bucket.
GCP
Hint
Just assign the string 'STANDARD' to the variable storage_class.
3
Set the storage class and lifecycle rule
Set the bucket's storage_class property using the storage_class variable. Then add a lifecycle rule to delete objects older than 365 days by appending a dictionary with action and condition keys to bucket.lifecycle_rules.
GCP
Hint
Assign storage_class to bucket.storage_class. Then add a lifecycle rule dictionary to bucket.lifecycle_rules with action type 'Delete' and condition age 365.
4
Enable uniform bucket-level access and create the bucket
Set bucket.iam_configuration.uniform_bucket_level_access.enabled to true to improve security. Then call bucket.create() to create the bucket in Google Cloud Storage.
GCP
Hint
Set bucket.iam_configuration.uniform_bucket_level_access.enabled = True and then call bucket.create().
Practice
(1/5)
1. Why is Cloud Storage important for storing object data in the cloud?
easy
A. It only stores data temporarily for a few hours.
B. It limits the size of each object to 1 KB.
C. It requires manual hardware setup for each object.
D. It provides scalable and durable storage for large amounts of data.
Solution
Step 1: Understand Cloud Storage purpose
Cloud Storage is designed to hold large amounts of data safely and reliably.
Step 2: Compare options
Options A, C, and D describe limitations or incorrect features, while B correctly states scalability and durability.
Final Answer:
It provides scalable and durable storage for large amounts of data. -> Option D
Quick Check:
Cloud Storage = scalable and durable storage [OK]
Hint: Cloud Storage is for big, safe, and lasting data storage [OK]
Common Mistakes:
Thinking Cloud Storage is temporary
Assuming manual hardware setup is needed
Believing object size is very limited
2. Which of the following is the correct way to create a new bucket in Google Cloud Storage using the gcloud CLI?
5. A company wants to store large video files that users can stream anytime. Which Cloud Storage feature best supports this use case?
hard
A. Coldline storage class for archival data with rare access.
B. Nearline storage class for infrequent access to save costs.
C. Multi-Regional storage class for high availability and low latency.
D. Standard local disk storage on a VM instance.
Solution
Step 1: Identify storage needs for streaming videos
Streaming requires fast access and high availability to serve many users anytime.
Step 2: Match storage classes to needs
Multi-Regional class offers low latency and high availability, ideal for streaming. Nearline and Coldline are for less frequent access. Local disk is not scalable or durable for this.
Final Answer:
Multi-Regional storage class for high availability and low latency. -> Option C
Quick Check:
Streaming needs Multi-Regional storage [OK]
Hint: Use Multi-Regional for fast, always-on access [OK]
Common Mistakes:
Choosing Nearline or Coldline for frequent streaming