Choosing an App Engine Environment

You can run an App Engine application in two environments, the standard environment and the flexible environment. You can use both environments in your application at the same time if you structure your application using the microservices architecture.

Comparing environments

The following table summarizes the differences between the two environments:

Feature Standard environment Flexible environment
Instance startup time Milliseconds Minutes
Maximum request timeout 60 seconds 60 minutes
Background threads Yes, with restrictions Yes
Background processes No Yes
SSH debugging No Yes
Scaling Manual, Basic, Automatic Manual, Automatic
Writing to local disk No Yes, ephemeral (disk initialized on each VM startup)
Customizable serving stack No Yes (built by customizing a Dockerfile)
Automatic in-place security patches Yes Yes
Network access Only via App Engine services (includes outbound sockets) Yes
Supports installing third-party binaries No Yes
Location United States or European Union While in Beta, United States only. European Union-hosted applications should not deploy apps to the flexible environment.
Pricing Based on Instance hours While in Beta, based on Compute Engine Pricing for each VM. Pricing will change in the future.

Flexible environment versus Compute Engine

While flexible environment runs services in Compute Engine VM instances, it differs from Compute Engine in the following ways:

  • Flexible environment VM instances are restarted on a weekly basis. During restarts Google's management services will apply any necessary operating system and security updates.

  • You always have root access to Compute Engine VM instances. SSH access to VM instances in the flexible environment is disabled by default. If you choose, you can enable root access to your app's VM instances.

  • Flexible environment VM instances are automatically located by geographical region according to the settings in your project. Google’s management services will ensure that all the VM instances for a project are co-located for optimal performance.

Migrating between environments

Google supplies Python, Java, and Go runtimes for the flexible environment that work with applications that were originally written for the standard environment and use the standard environment's APIs. Since these runtimes are backwards-compatible they are called "compat" runtimes. They can help you move an application from the standard environment to the flexible environment. Although 100% backward compatibility is not guaranteed, every compat runtime implements the flexible environment's life-cycle including health checking, and also has built-in support for a subset of the App Engine standard environment service APIs such as Datastore, Logging, Memcache, Search, Task Queues, URL Fetch, and Users authentication.

Because the two environments use different serving stacks, you might have to spend some time debugging and optimizing your migrated code. See the migration instructions for Python, Java, and Go for more information.

Enviar comentarios sobre...