Google Cloud – App Engine Standard vs Flexible Environment

Google Cloud – App Engine Standard vs Flexible Environment

Application Execution

  • Standard environment
    • Application instances that run in a sandbox, using the runtime environment of a supported language only.
    • Sandbox restricts what the application can do
      • only allows the app to use a limited set of binary libraries
      • app cannot write to disk
      • limits the CPU and memory options available to the application
    • Sandbox does not support
      • SSH debugging
      • Background processes
      • Background threads (limited capability)
      • Using Cloud VPN
  • Flexible environment
    • Application instances run within Docker containers on Compute Engine virtual machines (VM).
    • As Flexible environment supports docker it can support custom runtime or source code written in other programming languages.
    • Allows selection of any Compute Engine machine type for instances so that the application has access to more memory and CPU.
  • Standard environment
    • application can accesses services such as Datastore via the built-in google.appengine APIs.
  • Flexible environment
    • Google APIs are no longer available.
    • GCP recommends using the Google Cloud client libraries, which make the application more portable.

Scaling

  • Standard Environment
    • Rapid scaling and Zero downscaling is possible, can scale from zero instances up to thousands very quickly.
    • uses a custom-designed autoscaling algorithm.
  • Flexible Environment
    • must have at least one instance running for each active version and can take longer to scale up in response to traffic.
    • uses the Compute Engine Autoscaler.

Health Checks

  • Standard environment
    • does not use health checks to determine whether or not to send traffic to an instance.
  • Flexible environment
    • Instances are health-checked, that will be used by the load balancer to determine whether or not to send traffic to an instance and whether or not it should be autohealed.

Traffic Migration

  • Standard environment
    • allows you to choose to route requests to the target version, either immediately or gradually.
  • Flexible environment
    • only allows immediate traffic migration

Single zone failures

  • Standard environment
    • applications are single-zoned and all instances of the application live in a single availability zone
    • In the event of a zone failure, the application starts new instances in a different zone in the same region and the load balancer routes traffic to the new instances.
    • Latency spike can be observed due to loading requests and also a Memcache flush.
  • Flexible environment
    • applications use Regional Managed Instance Groups with instances  distributed among multiple availability zones within a region.
    • In the event of a single zone failure, the load balancer stops routing traffic to that zone.
  • Standard Environment
    • Deployments are generally faster than deployments in flexible environment.
    • VM Instance comes up in seconds in case of auto scaling
  • Flexible Environment
    • Instance startup time in minutes rather than seconds when compared to standard environment
    • Deployment time in minutes rather than seconds when compared to standard environment

Google Cloud - App Engine Standard vs Flexible Environment

GCP Certification Exam Practice Questions

  • Questions are collected from Internet and the answers are marked as per my knowledge and understanding (which might differ with yours).
  • GCP services are updated everyday and both the answers and questions might be outdated soon, so research accordingly.
  • GCP exam questions are not updated to keep up the pace with GCP updates, so even if the underlying feature has changed the question might not be updated
  • Open to further feedback, discussion and correction.
  1. You’re writing a Python application and want your application to run in a sandboxed managed environment with the ability to scale up in seconds to account for huge spikes in demand. Which service should you host your application on?
    1. Compute Engine
    2. App Engine Flexible Environment
    3. Kubernetes Engine
    4. App Engine Standard Environment
  2. A Company is planning the migration of their web application to Google App Engine. However, they would still continue to use their on-premises database. How can they setup application?
    1. Setup the application using App Engine Standard environment with Cloud VPN to connect to database
    2. Setup the application using App Engine Flexible environment with Cloud VPN to connect to database
    3. Setup the application using App Engine Standard environment with Cloud Router to connect to database
    4. Setup the application using App Engine Flexible environment with Cloud Router to connect to database