Greetings, developers.
This is Wesley Chun from Google.
Today we're going to cover the hot topic of where
to put your files in the cloud.
I'm really excited to introduce and describe
the various storage options that are available in Google's Cloud
so you can determine which may be right for you, enabling you
to build that next viral or even non-viral app.
The first pair of cloud storage options
we'll cover in this episode are Google Cloud Storage
and Google Drive.
If you're a developer, you may be
wondering what is the difference between Google Drive and Google
Cloud Storage.
I go to many tech conferences every year,
and this is a question that comes up regularly.
Aren't they both storage in the cloud?
Well, the answer is why yes, they are.
Both utilize the same underlying storage mechanism
provided by Google's infrastructure.
But the service offerings differ both for users as well as
developers.
Let's dig a little deeper into each.
Google Drive isn't part of the Google Cloud Platform.
But instead, it's a service tightly
integrated with the Google Apps ecosystem.
It's for creating and editing documents, sharing,
collaborating, and syncing your docs and personal files
to multiple devices.
Most users interact with Drive from the web interface
or mobile app.
So yes, there is a consumer aspect to Drive,
but it's for developers too.
Google Drive provides a RESTful web API for developers,
both client and server side, as well as
SDKs for Android and iOS.
These features allow you to build web or mobile apps that
give your users access to their Drive files and folders.
What kind of apps can you write?
Spell checking documents, creating new docs
based on the contents of a Google sheet.
In fact, in the Google Drive API documentation,
you'll find open source starter projects
that edit text files in Drive folders or unzip
files into a Drive folder.
Click the link to get access to those samples.
You can also access the Google Drive API
from Google Apps Script, which is
JavaScript outside the browser.
It's server side like Node, but runs on Google servers
and gives users programmatic access
to data in Google apps and other Google services,
including Google Drive.
Take a look at the short code snippet here.
It's just simple JavaScript that loops through your Google Drive
files and logs the file names to the console.
If you're familiar with add-ons for Google Docs and sheets,
they're powered by App Script.
How many of you have ever edited a Google Doc
simultaneous with other users?
I sure have, and we do it every day.
Well guess what.
You can create your own apps that let multiple people sign
on and collaborate together using the Google Drive Realtime
API.
How cool is that?
Got an app you'd love to see?
There's no need to wait for Google
to write it when you can do it yourself.
We empower you to scratch that itch.
Now that you know what Google Drive is,
what about Google Cloud Storage?
What do they have in common?
Well, in both cases, you've got data
that's persistent, fast, scalable, and highly available.
Both provide access control for individuals or groups.
However, large scale data such as backups, archives, big data,
and the processing of that data is
where Google Cloud Storage is a better fit.
Cloud storage is part of the Google Cloud Platform
where services are provided on behalf of a project
or application, rather than a user.
Also for some of you, it's critical to specify
where your data should be hosted.
And cloud storage supports that.
At this time, you can select either the US or the EU.
There are many ways by which you can access Google Cloud
Storage.
Through its website interface, the command line tool
which is part of the Google Cloud SDK,
by using the App Engine client library for your App Engine
apps, from Compute Engine instances using
built in service accounts that access
cloud storage data within the same project,
and the cloud storage RESTful API.
One of the benefits from cloud storage
is that you get access or your data
gets access to other services in the Google Cloud Platform.
Cloud storage data can be ingested
into tools which lets you query, normalize, transform or ETL,
perform analysis on, or otherwise process
all of your data.
These tools include Google App Engine apps,
your code running on Google Compute Engine
virtual machines, Google BigQuery, which gives you
the ability to analyze multiple terabytes of data
in mere seconds, Google Cloud SQL,
our fully managed highly available relational database
in Google's Cloud, and Google prediction,
our cloud based machine learning service.
As you can see, Google Cloud Storage isn't just for storage.
It's also an entry point.
OK.
One last option for file storage in the cloud.
Persistent disks.
Think of them as versatile hard drives
in the cloud available for your fleet of Google Compute Engine
virtual machines.
While instances boot from persistent disks,
their content lives independently
of VM creation and destruction.
Instances can mount multiple disks.
You can mount persistent disks on multiple instances,
read only, or read write if mounted only on one VM.
And you have the ability to take a point
in time snapshot of a persistent disk,
then restore it to any Compute Engine region in the world.
You can do any of these from Compute Engines web interface,
command line tool, or it's RESTful web API.
Now that you know about the different ways
to store files in the cloud, which you choose
depends on the type of app or solution
you're building for your users.
If it's working with documents or personal files,
with the added benefits of collaboration
and syncing or otherwise interacting in a Google Apps
domain, Google Drive is probably the best fit.
If working with a massive amount of data
with the need to have fine grained control over who
can access it, or if you're doing large scale analysis
or computation with that data, possibly using other Google
Cloud Platform services, I'd go with Google Cloud Storage.
With cloud storage, you can easily pop your data
to App Engine, BigQuery or Cloud SQL.
If that data processing takes place on Google Compute Engine
instances, you can easily transfer that data
to Compute Engines persistent disk just once
and be able to access it from multiple instances.
All right.
Now that you have all your options
for file storage in the cloud, go out there
and build that awesome app.
If you want to learn more, check out our other DevBytes,
including those which are data and storage related.
Thanks for tuning in.