Jump to Content
Developers & Practitioners

5-ish ways to get your data into Cloud Storage

March 6, 2021
https://storage.googleapis.com/gweb-cloudblog-publish/images/Cloud_storage_terminology.max-1300x1300.jpg
Jenny Brown

Developer Relations Engineer

Would you rather listen than read? Check out our new tech blog podcast.

So you’ve created your buckets, and now you want to use the power of the cloud to serve your content. With a can-do attitude and the details of this post, you’ll learn how to get your data into Cloud Storage with a variety of upload methods. Let’s go!

When you upload an object to your Cloud Storage bucket, it will consist of the data you want to store, along with any associated metadata. When it comes to the actual uploading, you’ve got a few different options to choose from, which we’ll go over below. For more detail, check out the documentation. And for general, conceptual information on uploads and downloads, read this.

Cloud console

First, we’ll cover the Cloud Console. This provides you with an in-browser experience where you can easily click to create buckets and folders, and then choose, or drag and drop the files from your local machine to upload.
https://storage.googleapis.com/gweb-cloudblog-publish/original_images/csb022_gif.gif

Pro-Tip: folder uploads are also supported if you’re using the Chrome browser.

gsutil

For production environments, you may want an automated, command line solution. 

For this, we provide the gsutil tool. gsutil is a Python application that lets you access Cloud Storage from the command line, providing you with the ability to do all sorts of things like creating buckets, moving objects, or even editing metadata.

To use it, run the gsutil program with a variety of command line options. For example, this command uploads a directory of files from your local machine to your Cloud Storage bucket using parallel upload.

https://storage.googleapis.com/gweb-cloudblog-publish/images/first.max-800x800.png

And this command lists out specific objects that have a version-specific URL using a wildcard. 

https://storage.googleapis.com/gweb-cloudblog-publish/images/second.max-800x800.png

More cool stuff you can do with the gsutil tool can be found in this documentation.

Client libraries

At some point, you might need to interface with Cloud Storage directly from your code, rather than going out to a command line option. You can include the client libraries into your code and call a simple api to get data into a bucket or folder. 

And before you even ask about language, with options in C++, C#, Go, Java, Node.js, PHP, Python, and Ruby—we’ve got you covered. 

For example, check out this Python code to upload an object to a Cloud Storage bucket:

lang-py
Loading...

Check out even more code samples here.

JSON and XML

And finally, if none of that does the trick, there’s always the JSON and XML APIs, which can let you kick off an HTTP POST request to upload data directly to a bucket or folder. It’s a bit more complex, but it’s there if you need it.

Loading...

Cloud Storage Transfer Appliance

Now, for you folks with LOTS of data, it’s worth noting that it might not be feasible to upload all of that data directly from your on-prem systems to Google Cloud—for that you can use the Cloud Storage Transfer Appliance. 

We ship you a fancy device, you connect it, add your data, and send it back to us. Plus you get this cool looking box on your desk for a while, which can be a great conversation starter, if you’re into that kind of thing. More details here.

https://storage.googleapis.com/gweb-cloudblog-publish/images/Transfer_appliance.max-400x400.jpeg

More clouds, more problems? Not so!

Don’t worry if your data is in another cloud, we’ve got easy-to-use guides to help you get up and running with supporting a multicloud environment, and getting that data over to Cloud Storage.

Now what?

Of course, now that the data is in Cloud Storage, you’ve got to figure out the best ways to serve it to your users worldwide. Stay tuned for best practices around getting that data out into the world in our next post.

Learn more about your storage options in Cloud Storage Bytes, or check out the documentation for more information, including tutorials.

Posted in