Learn the optimal approach for connecting air quality monitoring devices to a cloud backend while minimizing latency, using managed instance groups and load balancers on Google Cloud Platform.
Table of Contents
Question
You work for an environmental agency in a large city. You are developing a new monitoring platform that will capture air quality readings from thousands of locations in the city. You want the air quality reading devices to send and receive their data payload to the newly created RESTful backend systems every minute by using a curl command. The backend systems are running in a single cloud region and are using Premium Tier networking. You need to connect the devices to the backend while minimizing the daily average latency, measured by using Time to First Byte (TTFB). How should you build this service?
A. 1. Run the air quality devices’ backends on Compute Engine VMs.
2. Create a weighted round robin routing policy on Cloud DNS.
3. Configure the air quality devices to connect by using this DNS.
B. 1. Run the air quality devices’ backends on Compute Engine VMs.
2. Create a round robin routing policy on Cloud DNS for these Compute Engine VMs.
3. Configure the air quality devices to connect by using this DNS.
C. 1. Run the air quality devices’ backends in a managed instance group.
2. Create an external passthrough Network Load Balancer to connect to the managed instance group.
3. Configure a connection between the air quality devices and the Network Load Balancer.
D. 1 Run the air quality devices’ backends in a managed instance group.
2. Create an external Application Load Balancer, and connect it to the managed instance group.
3. Configure a connection between the air quality devices and the Application Load Balancer.
Answer
D. 1 Run the air quality devices’ backends in a managed instance group.
2. Create an external Application Load Balancer, and connect it to the managed instance group.
3. Configure a connection between the air quality devices and the Application Load Balancer.
Explanation
- Using a managed instance group (MIG) to run the backend instances provides autoscaling, load balancing, auto-healing, and rolling updates out of the box. This ensures the backend can automatically adjust capacity based on demand and maintain high availability.
- An external Application Load Balancer is the optimal choice here because it operates at layer 7 (the application layer) and can intelligently route HTTP(S) requests based on paths, headers, cookies etc. It terminates the SSL connection and can do intelligent load balancing close to the backends.
- Connecting the air quality devices directly to the Application Load Balancer’s IP address or domain name front-ends the MIG and provides a single stable endpoint for the devices. The ALB distributes traffic evenly to the healthy instances.
The other options are not ideal because:
- Options A and B use individual Compute Engine VMs instead of a MIG. This requires manually handling scaling, updates, and failover.
Options A, B and C all use DNS-based load balancing which has some drawbacks compared to an Application Load Balancer:
- DNS responses are cached by the devices, so traffic can get routed to unhealthy instances. An ALB routes each request independently to healthy instances.
- DNS round-robin distributes requests randomly, while an ALB does smarter routing based on utilization.
- DNS doesn’t allow intelligent routing based on HTTP attributes like path, headers, cookies.
So in summary, using a managed instance group with an Application Load Balancer provides the most robust, scalable and intelligent setup to ensure low latency and high availability for the air quality monitoring devices.
Google Professional Cloud Developer certification exam assessment practice question and answer (Q&A) dump including multiple choice questions (MCQ) and objective type questions, with detail explanation and reference available free, helpful to pass the Google Professional Cloud Developer exam and earn Google Professional Cloud Developer certification.