App Engine is a fully managed serverless computing service from the Google Cloud Platform that makes it easier to manage a backend of microservices. It is based on high scalability without you having to manage your own servers.
What is App Engine?
App Engine is essentially a set of microservices. Traditional applications are usually monolithic, which means you run a large runtime service on a server that handles everything. What usually happens in the real world, however, are different parts of the application that experience different traffic, usage and total load. You end up with bottlenecks, where you want to be able to pull out part of your backend and run more instances of it to keep up with demand.
The design principle for micro-services solves this problem. In a micro-service-based backend, each service handles only what is required of it. This allows you to distribute multiple copies of the services you need more of. It also allows you to easily distribute updates to only those services that need updating.
It is common to use serverless computing services such as AWS Lambda functions or GCP Cloud functions to easily deploy individual functions as services. App Engine is very similar but is much more powerful because it is built specifically for micro services.
Just like cloud features, you do not need to manage any underlying servers. You just upload your code, select a run time and let it run. If you use the flexible environment, you can distribute your application as a Docker container, which gives much more flexibility.
Unlike cloud features, however, you need to run “Instances” for each service. Your fees are based on this and not based on individual function calls, as there is no such thing as a cold start available. (You can reduce the scaling to 0 instances in the default environment, but cold start will be slow.)
App Engine currently supports the following runtime environments, but if you use the flexible environment, you can run custom operating times in Docker containers.
- Python 2.7, Python 3.7
- Java 8, Java 11
- Node.js 8, Node.js 10
- PHP 5.5, PHP 7.2, PHP 7.3 and PHP 7.4 (beta)
- Ruby 2.5 (beta)
- Go 1.11, Go 1.12, Go 1.13 and Go 1.14 (beta)
For data storage and endurance, there is a built-in data warehouse, but it is being phased out in favor of Firestore, a NoSQL document database offered as part of the Firebase platform. It has a data storage mode especially for compatibility with App Engine’s built-in data storage. There is also a memcache as a service, custom task queues and cron jobs available from the App Engine console.
To get started, Google offers lots of built-in tutorials from the App Engine console.
Standard versus flexible environments
App Engine has two different environments you can choose from, both with advantages and disadvantages.
The first and default environment is the default environment. This mode acts as a calculation engine with predefined instance classes and VM configurations where you are billed every hour based on usage. Of course, you do not have to handle these yourself – the App Engine handles it and the environment is sandboxed. This environment has the advantage of fast distributions and the possibility of zero downscaling, although cold starts can still be slow.
But by default you do not get SSH access, nor do you get background processes like cron (although Google provides this as a managed service). There is a start-up and shut-down cost of 15 minutes beforehand, so you want to avoid overly aggressive automatic scaling.
The flexible environment uses Docker containers to run everything. However, if you use one of the supported driving times, you may not need to handle the container yourself. You get SSH access, much more flexibility (it’s in the name) and support for background processes. Implementations and launches, however, take a few minutes and you will not have access to some built-in App Engine services as memcached.