Google Professional Cloud Network Engineer Question 489
Select 2Google Cloud PlatformYour organization is hosting a public API on Google Cloud using Cloud Load Balancing with backend services deployed on Compute Engine. Due to an increase in traffic, some backend services are becoming overwhelmed, causing degraded performance. You’ve been tasked with configuring rate limiting to ensure the backend services are not overloaded while still maintaining a good user experience. Which steps should you take to implement rate limiting in this scenario?
- A
Use Google Cloud Armor to create a security policy with rate-based rules and attach it to the load balancer.
- B
Configure a firewall rule to limit the number of requests allowed per IP address.
- C
Implement a quota system in the API backend code to restrict request rates per user.
- D
Enable rate limiting directly in the backend instance group configuration.
- E
Set up a Cloud CDN policy to cache requests and reduce the load on backend services.
Show answer and explanation
Correct answers: A, C
Explanation
To configure rate limiting in this scenario, you can use Google Cloud Armor to define rate-based rules and protect your backend services. Additionally, implementing a quota system in the API backend code ensures that individual users or API keys do not exceed allowed request rates. These two methods work together to prevent backend overload while maintaining proper functionality. Other options, such as firewall rules, instance group settings, or Cloud CDN, do not directly address rate limiting.
- A. Correct.
Google Cloud Armor allows you to define security policies that include rate-based rules, which can be attached to your load balancer to limit excessive traffic and protect backend services.
- B. Incorrect.
Firewall rules in Google Cloud are used to allow or block traffic based on IP addresses, ports, and protocols but cannot be used to implement rate limiting.
- C. Correct.
A quota system in the backend API code is a valid approach to restrict request rates per user or API key, ensuring fair usage and preventing service overload.
- D. Incorrect.
Rate limiting cannot be directly configured in the backend instance group. Instance groups manage scaling and health checks but do not handle traffic rate limiting.
- E. Incorrect.
Cloud CDN helps reduce backend load by caching responses, but it does not enforce rate limiting or restrict the number of requests sent to the backend services.