Let me know if this has
ever happened to you– where you have this brilliant idea of
an app that you want to build, and all you want to do is run
home and start working on it. As you start building
it, though, you quickly realize you need a
back end or a server in the cloud to really
demonstrate the full idea. And so you fire up a
browser and start searching. How do you build a back end
server for a mobile or web app? Well, it turns out you get
over a million search results with all sorts of articles
and discussion threads. And it can be
overwhelming to figure out how to integrate all of
these technologies together. But the good news is that
a lot of the complexity is handled for you with
Google Cloud Endpoints. It has a
straightforward workflow so you can build a shared back
end for your Android, iOS, and web clients. Previously, I was an engineer
on the Google Keep team and was exposed to
the issues that I’ll be talking about today,
with building a new product with multiple clients
accessing a back end. And that’s why I want to
help you get your service up and running as
quickly as possible. On the server, you
simply define your API and add Cloud
Endpoint annotations. There’s an awesome tool
to automatically generate the client libraries
that you can drop into your respective apps. You implement the client
code to call your API and the server side logic with
what to do an API is called. And then everything
else in between is handled by Cloud Endpoints. Over time, your server
API will naturally evolve. And that’s where Cloud
Endpoints can really help reduce those accidental
errors, because it automatically generates the
client libraries for you. When you’re ready to release the
clients with your latest build, we’ll help you handle
the upgrade smoothly. Now, this is made
possible by API burgeoning support in Cloud Endpoints. Different API versions
can actually coexist, and you can do a gradual stage
roll out of these new changes. In this example, new clients
can start to talk to the V2 API while your order
clients slowly move over until you deprecate
the old V1 API. I also want to note that the
back end server that we’re talking about is actually
running on Google App Engine, which is part of the
broader Google Cloud Platform. Not only do you get a shared
back end for your Android iOS and web clients,
but you can also take advantage of all the
other products and services that are available. With App Engine
comes the ability to actually scale very easily. As you get more traffic,
Google automatically spins up more App Engine
instances for you. And then when the traffic
levels off after the peak, we kill off the instances
that you don’t need any more. You don’t need to
trouble yourself with estimating resources needs
ahead of time, so it’s great. As an added bonus,
Cloud Endpoints comes with web management tools,
such as this API Explorer, which allows you to interact
with all of your API endpoints. As seen here, you
can create a request and then see what
the response is. If you want a
bird’s eye overview of how healthy the service is
for the actual users out there, on the dashboard,
you can check graphs with QPS, latency,
and error rates. You also have access to the logs
if you want more detailed data. But enough about development. What type of impact can
Cloud Endpoints really have on your users? Well, users expect the
app to be blazing fast, without those loading
spinners that spin forever. It’s not ideal if you have a
user halfway across the world and they’re trying to
hit the server that’s located in your basement. Instead, you can take
advantage of Google’s global infrastructure. We have data centers
all over the world and we can route requests to
the appropriate data center quickly. Now, users also care about
minimizing network usage, which impacts
their bill, as well as they want to
minimize battery usage. Therefore, once we
serialize the data, we compress it for efficient
transfer across the network. Now, we know, also,
users want peace of mind that their data is being
kept and transferred as securely as possible. So all of our requests
are sent over HTTPS. And we also have OAuth
2.0 support built in to authenticate and
authorize the users to access the appropriate data. So as you can see,
Google Cloud Endpoints is a straightforward way for
you to build a shared back end for your Android,
iOS, and web clients. And if you have that
browser still open, you can search for Google
Cloud Endpoints now. Or you can use the links here. Next time you have that great
idea, now you know what to do.