Learn the best practice for deploying a stateless application with fluctuating traffic on Google Cloud. Discover which service provides optimal automatic scaling for VM-based applications.
Table of Contents
Question
Your team has developed a stateless application which requires it to be run directly on virtual machines. The application is expected to receive a fluctuating amount of traffic and needs to scale automatically. You need to deploy the application. What should you do?
A. Deploy the application on a managed instance group and configure autoscaling.
B. Deploy the application on a Kubernetes Engine cluster and configure node pool autoscaling.
C. Deploy the application on Cloud Functions and configure the maximum number instances.
D. Deploy the application on Cloud Run and configure autoscaling.
Answer
A. Deploy the application on a managed instance group and configure autoscaling.
Explanation
For a stateless application that needs to run directly on virtual machines and handle fluctuating traffic with automatic scaling, a managed instance group (MIG) with autoscaling is the most appropriate solution in Google Cloud Platform (GCP).
Here’s why:
- Virtual Machine Requirement: The question explicitly states that the application needs to run directly on virtual machines. This immediately rules out options B (Kubernetes Engine), C (Cloud Functions), and D (Cloud Run), as these are serverless or container-based solutions.
- 2Stateless Nature: The application being stateless makes it ideal for horizontal scaling, which is a key feature of managed instance groups.
- Automatic Scaling: Managed instance groups offer built-in autoscaling capabilities. You can configure autoscaling based on various metrics such as CPU utilization, HTTP load balancing serving capacity, or custom metrics.
- Fluctuating Traffic: MIGs can automatically add or remove instances based on the current load, making them perfect for handling fluctuating traffic patterns.
- High Availability: MIGs distribute instances across multiple zones in a region, ensuring high availability and fault tolerance.
While the other options are valuable GCP services, they don’t meet the specific requirements outlined in the question:
- Option B (Kubernetes Engine): While it supports autoscaling, it’s container-based and doesn’t run applications directly on VMs.
- Option C (Cloud Functions): This is a serverless, event-driven compute platform, not suitable for running applications directly on VMs.
- Option D (Cloud Run): Another serverless platform for containerized applications, which doesn’t align with the VM requirement.
In conclusion, for a stateless application that needs to run on VMs and scale automatically with fluctuating traffic, deploying on a managed instance group with configured autoscaling is the most appropriate solution in Google Cloud Platform.
Google Associate Cloud Engineer certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Google Associate Cloud Engineer exam and earn Google Associate Cloud Engineer certification.