In this next section, you’ll explore how App Engine can run your applications without
requiring you to manage the infrastructure.
App Engine lets you build highly scalable applications on a fully managed, serverless
platform.
App Engine is ideal if time-to-market is highly valuable to you and you want to focus on writing
code without ever having to touch a server, cluster, or infrastructure.
It’s also ideal if you don’t want to worry about a pager going off or receiving 5xx errors!
App Engine allows you to have high availability apps without a complex architecture.
So, how does it work?
With App Engine, you can choose from popular coding languages, libraries, and frameworks
to develop apps with tools you’re familiar with, and then automatically provision servers
and scale app instances based on demand.
Options include Eclipse, IntelliJ, Maven, Git, Jenkins, and PyCharm.
That means that you can upload your code, and Google will manage your app's availability.
App Engine also provides built-in services and APIs, like NoSQL datastores, Memcache,
load balancing, health checks, application logging, and a user authentication API that
is common to most applications.
App Engine offers software development kits, or SDKs, to help you develop, deploy, and
manage your apps on your local machine.
Each SDK includes: All of the APIs and libraries available to
App Engine, A simulated, secure sandbox environment that
emulates all of the App Engine services on your local computer,
And deployment tools to upload your application to the cloud and manage different versions.
The SDK manages your application locally, and the Google Cloud Console manages your
application in production.
Use the Cloud Console’s web-based interface to create new applications, configure domain
names, change which version of your application is live, examine access and error logs, and
more.
There are two types of App Engine environments: standard and flexible.
The first is the App Engine standard environment, which is based on container instances running
on Google's infrastructure.
Containers are preconfigured with a runtime from a standardized list of supported languages
and versions, which include libraries that support App Engine standard APIs.
For many applications, the standard environment runtimes and libraries may be all you need.
Standard environment features include:
Persistent storage with queries, sorting, and transactions.
Automatic scaling and load balancing.
Asynchronous task queues for performing work outside the scope of a request.
Scheduled tasks for triggering events at specified times or regular intervals.
And integration with other Google Cloud services and APIs.
There are a couple of requirements for using the standard environment:
You must use specified versions of Java, Python, PHP, Go, Node.js, and Ruby.
Your application must conform to sandbox constraints that are dependent on runtime.
Applications run in a secure, sandboxed environment.
This allows the App Engine standard environment to distribute requests across multiple servers
and scale servers to meet traffic demands.
This means that your application runs within its own secure, reliable environment that
is independent of the hardware, operating system, or physical location of the server.
A standard environment workflow typically follows these three steps:
First, a web application is developed and tested locally.
Second, the SDK is used to deploy the application to App Engine.
And third, App Engine scales and services the application.
App Engine also offers a flexible environment.
If the standard environment’s sandbox model is too restrictive for you, the flexible environment
can let you specify the type of container your web application will run in.
This option lets an application run inside Docker containers on Google Cloud’s Compute
Engine virtual machines.
In this case, App Engine manages Compute Engine machines for you.
This means that: Instances are health-checked, healed as necessary,
and colocated with other module instances within the project.
Critical, backward-compatible updates are automatically applied to the underlying operating
system.
VM instances are automatically located by geographical region according to the settings
in your project.
Google's management services ensure that all of a project's VM instances are colocated
for optimal performance.
And VM instances are restarted on a weekly basis.
During restarts, Google's management services will apply any necessary operating system
and security updates.
The flexible environment supports microservices, authorization, SQL and NoSQL databases, traffic
splitting, logging, search, versioning, security scanning, Memcache, and content delivery networks.
App Engine Flexible allows users to also benefit from custom configurations and libraries while
still keeping their main focus on what they do best – writing code.
In addition, the App Engine flexible environment allows you to customize the runtime and the
operating system of your virtual machine by using Dockerfiles.
As in App Engine Standard, supported runtimes include Python, Java, Go, Node.js, PHP, and
Ruby.
However, in App Engine Flexible, developers can also use different versions of these runtimes
or provide their own custom runtime by supplying a custom Docker image or using a Dockerfile
from the open source community.
So, how do these two environments compare to each other?
Let’s start with the standard environment, which is fast.
It starts up instances of your application in seconds, but you have less access to the
infrastructure in which your application runs.
With the standard environment, you can’t use ssh to connect to the virtual machines
on which your application runs, and you can’t write to a local disk.
The standard environment does support third-party binaries for certain languages, and you can
use App Engine to make calls to the network.
Finally, in terms of pricing, after a free tier usage, you pay per instance class with
automatic shutdown.
The flexible environment takes minutes to start up, instead of seconds.
But it lets you use ssh to connect to the virtual machines on which your application
runs, it lets you use local disk for scratch space, it lets you install third-party software,
and it lets your application make calls to the network without going through App Engine.
In terms of pricing, with the flexible environment, you pay for resource allocation per hour with
no automatic shutdown.
Because App Engine uses Docker containers, you may be wondering how App Engine compares
to Google Kubernetes Engine.
App Engine's standard environment is for people who want the service to take maximum control
of their web and mobile application’s deployment and scaling.
Google Kubernetes Engine, however, gives the application owner the full flexibility of
Kubernetes.
App Engine's flexible environment is somewhere between the two.