So you have a great idea for an app that's
going to run across mobile, tablets, laptops, and PCs.
And after you've done all the hard work of designing the UI,
now it's time to get to the really hard problems.
That is, how do you get all of these devices communicating
between one another.
It's time to take advantage of the cloud.
Acting as a central resource each client
can use the cloud to send and receive messages
keeping all the other clients in sync with each other.
But not every cloud is created equal,
you'll want something that's easy to use,
won't become an ongoing maintenance headache,
and of course, scale, just in case
your app becomes a smashing success.
Enter Google App Engine, which makes
it easy to build scalable cloud solutions for web
apps and mobile backends.
App Engine reduces the pain of building these solutions
by providing a suite of powerful usable services,
and it also reduces deployment panes
by automatically running and managing
your applications for you.
This ensures that your app always
has the right amount of server capacity
to handle your traffic, not too much, not too little.
But back to the point, you're building the next great app--
how can Google App Engine help with that?
Let's say user a wants to send a message user b,
but user b isn't currently online-- we're
going to need some place to store the message.
The App Engine Data Store is the easiest choice for this.
It's part of App Engine so it's ready to use
with no configuration or set up needed.
You hand your data to App Engine and it
takes care of replicating it to multiple data
centers across the world, so it's
always available to your global customers--
no scheduled maintenance or configuration headaches
required.
But best of all the Data Store will
continue to scale whatever size your app needs.
As you write more data, you get more capacity
all without having to lift a finger.
And of course storing messages is only half the problem, when
user b comes back online, you'll need
to retrieve any messages waiting for her.
And to do this you'll need to server logic
to fetch the right messages for the specific user
and return them to the appropriate client.
And thankfully you can author that server side logic in one
of our many supported languages like Java, Python, Go, and PHP.
Now as the number of your users grow
you'll notice that your app often ends up
fetching the same data over and over and over and over again,
frankly some data's just more popular than other data.
Fetching this data does take a bit of time and computation,
and repeated fetches have the same information
is hugely wasteful.
To avoid melting your servers with wasteful fetching,
App Engine provides a feature to improve
retrieval speed called, Memcache.
Memcache allows you to store commonly accessed data in fast,
in memory distributed cache, so your app
isn't sitting around waiting for a bunch of data store rights
or for some business logic to execute.
Also did I mention less melting?
That's a really important part.
Of course besides the Data Store and Memcache,
there is a plethora of APIs at your disposal,
but that's another video.
Anyhow, back to your app-- using Data Store and Memcache
you can store and retrieve data quickly.
The runtime logic allows you to specify customer request
handlers so your client gets exactly the responses they
need, however you don't always want your clients
to wait around for server side logic to finish.
Sometimes you want the server to do some work
and you want your clients to come back later for the result.
For example processing an upload video or applying an awesome
filter to a picture of a soon-to-be-eaten entree.
These high-compute operations take a bit of time to finish
and leaving the client connection opened
during this time can chew up your users' batteries
which doesn't make for great user experience.
Plus there's probably work your app wants
to do when no one else is around like gathering statistics
of how many of your users are interacting
with one of your new features.
To help with this, App Engine provides the tasks
API, which allows you to schedule work
to be run later or in the background which
is important to keep your user's battery from melting
while waiting for the server to finish work,
but that's another video.
At this point you have a basic app set up and running.
As your app grows, you'll probably
want to add support for binary files,
like a user profile photo or some awesome homemade music.
Now while the Data Store is built for structured data,
it might not be the right place for binary files.
As such, it's to look deeper at your storage options.
Google Cloud Storage is up to this particular task,
allowing you to store an unlimited number of files
or objects up to terabytes in size that are available
globally, each with the access controls that you specify.
And so far we've talked about how App Engine scales
on the back end, but it's also worth
pointing out how App Engine provides
another invisible layer which helps your app scale as well.
You see App Engine provides a dedicated
layer of Front Ends which make sure client data get off
the internet and on to Google's network as quickly
as possible, while also making sure that your code and the App
Engine run time don't have to wait around for slow
or poorly connected clients.
Now don't forget, your clients can
talk directly to many of the back end
services without needing to go through your server side code.
For example, your user can upload an image and data
directly to Cloud Storage or grab structured data
right from the Cloud Store API and even
talk directly to the tasks API to see
what pending work is available for processing.
Before you go running off to build your app,
there's a bit of planning that needs to happen though.
Namely as your service or back end changes
over time keeping your Android, web and iOS
clients in sync with those changes
becomes a really gnarly task.
To help with this, Cloud Endpoints
makes your life just a little bit easier.
You simply define your server API
and the Cloud Endpoints will generate the client libraries
for you, which not only takes care of data serialization
but handles the connection and minimizes transport
bloat across the wire.
With all of these features and services and your command,
Google App Engine allows you to build the next great app
and scale it big with the least amount of trouble for you.
See, building the next amazing app is as easy as that.
Now go build something great.