LAURENCE MORONEY: Welcome to getting
started with App Engine.
My name is Laurence Moroney, and I'm a developer advocate
at Google for the Cloud Platform.
In this video, I'll give you an overview
of how you can use App Engine to build cloud scalable apps that
are always available, thanks to them running
on Google's infrastructure for you.
The Cloud Platform has a number of different technologies
that you can use, and these enable a variety of scenarios,
giving you platform as a service,
as well as infrastructure as a service,
as well as just about everything you could ever
need to build cloud scalable applications that
run on Google's secure, scalable,
and available infrastructure.
In this video, I will introduce App Engine
and describe how you can use App Engine to build applications
on top of Google's infrastructure,
allowing you to focus on writing your code,
and not worrying about being able to build
the infrastructure to support it,
should you need to scale in a big way.
With App Engine you can use a variety of popular programming
languages in a way that you are familiar,
with very little changes.
You can build cloud scalable apps with Python, PHP, or Go,
using your favorite development tools in a local environment
for testing and debugging your app
before you deploy it to the cloud.
App Engine also supports Jave, and with an Eclipse plug-in,
you can also develop, test, and debug locally
before you deploy it to the cloud.
When building web or cloud apps, there are many considerations.
But perhaps the most important of these is your data.
App Engine gives you a myriad of choices
for how you store and retrieve your data,
and you can pick the ones that suit you.
Google Cloud Datastore is a very simple NoSQL data storage
scheme.
You simply create an object like this
and put it into the datastore.
You can retrieve your object easily
in a variety of ways, including a SQL like language college
GQL.
Here you can see an example where
I have a model that I called Answers,
and answer can have a number of attributes, such as author,
city, or country, and I simply just set these attributes
and then put my answer into datastore.
GQL looks a lot like SQL, and as you can see here,
I have a query that says select city from answer, where
I can just take a look at all of the cities
that I have answers for.
If your application requires you to store
a lot of data and right time is an issue,
for example, if you have a lot of concurrent users
and you don't want to burn resources writing data,
then Google Cloud Datastore is a terrific option.
Should you prefer to use a traditional relational
database, or if you have an existing database that you'd
like to migrate to the cloud, then Google Cloud SQL
is built for you.
Built upon MySQL, it gives you a powerful, scalable database
with full SQL support.
Here you can see I'm connected to MySQL database
and I'm creating a cursor on which I
can execute a SQL query.
Once I have that query, I can iterate
through all the rows of that query
and pull out the columns that I want before I finally
close the database.
Of course, if you need to store your information in something
other than a database, for example,
files in a file system for pictures or other media,
you can use Google Cloud Storage.
This is a RESTful service for storing, accessing,
and providing controlled access to your data on Google's
infrastructure.
The Google Cloud Storage client library is available for you
to build applications that use cloud storage.
Here's an example, and you can see
it's just like programming for any kind of file system.
I can open a file, I can write to it and close it.
Or I can open the file and then seek
to a specific location on that file.
And, of course, I can just delete the files
that I don't want.
If you want to use data with maximum speed,
you can do it directly to memory instead of
to a datastore or a database.
To empower this, App Engine introduces
Memcache, a technology for storing information
in shared memory as a key valued pair.
Here are some examples of using the Memcache APIs.
I could add a new value to Memcache
by calling the add method.
In this I can specify the key and the value,
as well as an optional timeout parameter, after which,
App Engine will automatically flush the memcache variable,
saving me my resources.
I can get a value from Memcache by specifying the key that I
want to read, or I can also set a value in Memcache
using the set method.
A handy shortcut for numerical values is this increment call.
It saves me from getting the value,
changing it, and then resetting it.
These are just a few simple samples.
There's a lot more in using Memcache at the developer site
that you'll see at the end of this video.
Everything about your app can be managed
using the App Engine console.
From here, you can see how your app is performance,
as well as being able to inspection your data,
be it a datastore, Cloud SQL, or Memcache.
Using App Engine, you can take your web applications
to the cloud and not have to worry about scale.
All web applications have peaks and troughs of usage,
and when built on App Engine, you
don't have to worry about paying for the compute power
that you don't use, and you can rest
assured that when you need it, Google's
powerful infrastructure is there to power your site.
You can learn more about App Engine
at developers.google.com.
Thank you and welcome to the cloud.