Getting Started: The Basics of Cloud Storage
So you’ve got to serve static assets from the cloud — You’ve heard of Cloud Storage, but aren’t in the mood to make our library of documentation your weekend reading. That’s totally understandable, and this post will give you a high-level overview, focusing on some basics: buckets, objects, and storage classes, oh my!
According to the official documentation, which I’ve read for you, Cloud Storage is a unified object storage. To expand on this, and bring it closer to home, consider Cloud Storage as the place where you can store and serve static binary assets either for your app to use, or directly to your users.
As straightforward as that sounds, there’s a lot going on under the hood — choices to make, and new words to learn — in order to leverage the power of Cloud Storage in your apps, you gotta know what all this means.
So let’s start with some vocabulary.
Terminology
While you’ve heard these words before, they’ve got specific definitions when it comes to Cloud Storage. Any piece of data you store in Cloud Storage is called an object, and objects are organized into buckets.
Buckets are really important because they let you control access to your data at a macro level — that’s why there’s specific restrictions on how you name, create, delete, and even access them.
In fact, one of the most important design patterns you’ll find is to design your apps for less bucket ops, and more object ops instead.
When we say “object ops”, we mean “object operations” and by “object operations” we mean operations relating to the individual pieces of data you store in a bucket in Cloud Storage. For example, using the REST API to set the HTML header for a specific object — or changing metadata on it.
Furthermore, all data in Cloud Storage belongs inside a Google Cloud project, which consists of users, APIs, and billing, among other things. All three of these are also known as resources, which refers to any entity within Google Cloud Platform.
Both objects and buckets are flexible, and extremely powerful. They both come with a federation of APIs and functionality depending on your use case, letting you create, delete, rename, and set properties on all of them. Check out this handy article on Key Terms for more.
With all that out of the way, let’s take a look at getting started with Cloud Storage.
Getting Started in the Console
You can set up buckets and upload objects in the Google Cloud Platform Console, a UI where you can interact with Cloud Storage, and this is where you’ll see that you have a few options regarding the storage class and location.
The choices you make here are important, and before you get overwhelmed with the decision, stop and breathe. We’ve got solid documentation, and more specific posts about this for you, but for now, here’s the quick version:
Storage Class
Storage Classes are chosen by you or assigned based on a particular bucket, and affect the object’s availability and pricing model.
You have 4 options when it comes to storage class:
Standard, Coldline, Nearline, and Archive — Standard is for the stuff you’re accessing all the time, and the other three options are for things you access less and less frequently.
When you create a bucket, you can specify a default storage class for that bucket, and when you add objects, they will inherit this same storage class unless you specifically set it otherwise. More details here.
Bucket Location
Your bucket location should be chosen with consideration for latency, availability, and bandwidth costs for data consumers. A good balance will ensure that your users have the data they need when they need it, while keeping those costs down.
You have a few options when it comes to the type of bucket location:
Region, dual-region, and multi-region. Your location will impact latency and should be chosen based on users and need for redundancy.
Again, check out the documentation or our other posts for the specifics on this.
Level Up
Now that we’ve established some of the basic terminology, feel free to leisurely peruse some of our documentation, or learn more about your storage options in Cloud Storage Bytes.
Check out other posts where we show you those concepts in action — more ways to access and interact with Cloud Storage, and best practices for your business case.