Prepare and test your skills
Prepare and test your skills
Security and Traffic Management Policies in Google Cloud are the controls that decide who can call an API and how much traffic can reach backend services. Apigee (opens in a new tab) enforces these controls at the proxy layer between clients and backends. Security checks block unauthorized callers, while traffic controls protect backends from overload and resource exhaustion. Together they keep services available during spikes, attacks, and partial failures.
API key validation in Apigee is a proxy-level check that allows only registered consumers with a valid key to reach a backend API. Traffic flows from the client application to the Apigee API proxy, the proxy resolves the request.queryparam.apikey variable against an API product, and only validated requests flow from the proxy to the backend service. If the key variable cannot be resolved, the proxy returns a fault such as steps.oauth.v2.FailedToResolveAPIKey instead of forwarding the request. To enable validation, an API product must include the API proxy, and a developer must be created and registered with that product to obtain an API key.
Rate limiting is a traffic management mechanism that caps the number of requests a service can receive over time to prevent failure under excessive load. A rapid or sustained increase in load can come from malicious requests such as network-based distributed denial-of-service (DDoS) attacks, and sudden spikes can also come from configuration errors in client software. When the application is not designed for that load, the application or the resources it depends on can fail and become unavailable. Google Cloud handles this risk with quotas, including quotas for the number of API requests a service can receive and project-level quotas that also limit the billing a project can incur.
Graceful degradation is a design approach where a system under high load keeps working with reduced performance instead of failing completely, then resumes full function when load drops. Apigee supports graceful degradation through throttling, where each replica independently slows incoming requests during high-traffic times. Policy rules in Apigee control how request rates are scaled back, so frontend throttling drops excess requests early to protect backend components.
Effective graceful degradation combines several related practices:
Dropping some requests early minimizes outage impact, in contrast to circuit-breaking where all traffic is dropped during overload.
Load balancing improves reliability by routing traffic only to available resources and by keeping individual resources from becoming overloaded. Traffic should be balanced between application tiers as well as from external clients, for example with an internal load balancer for reliable communication between the web and application tiers in a 3-tier stack. For global applications, Network Service Tiers (opens in a new tab) Premium Tier routes inbound traffic from the internet onto the high-performance Google network at the point of presence (PoP) closest to the sender, then within the Google network from the entry PoP to the Google Cloud resource, while outbound traffic exits at the PoP closest to the destination.
Load-balancing health checks ensure that load balancers route application traffic only to backends that are responsive, even when infrastructure looks healthy. All virtual machines (VMs) hosting an application can be in the RUNNING state while the application software on some VMs has crashed, so health checks separate infrastructure state from application responsiveness. If backends are managed instance groups (MIGs), an extra layer of health checks can enable autohealing, where the MIG depends on the health check signal to proactively delete unavailable VMs and create new VMs.
Apigee access routing controls whether an Apigee runtime instance is reachable from the internet or only from inside a virtual private cloud (VPC) network. Traffic flows from external clients through a Layer 7 global external load balancer to the Apigee runtime when internet access is enabled, while internal-only traffic flows from a VM inside the network to the Apigee instance with no external path. The routing location determines failover scope and data residency behavior.
| Routing option | Load-balancing scope | Choose when |
|---|---|---|
| Global | Global load balancing with high availability and automatic failover across all regions; API requests automatically reroute if one region fails | High availability across regions is needed and advanced data residency is not enabled |
| Regional | Load balancing restricted to the same region as the Apigee instance | Data residency must keep traffic in the same region |
For external access, the domain and certificate model further controls exposure. The automatically managed option uses the nip.io wildcard Domain Name System (DNS) service with a Google-managed certificate, while the customize option allows a custom domain name, subnetwork in the same region as the runtime instance, and Secure Sockets Layer (SSL) certificate. A Google-managed certificate can take up to 60 minutes to create, and Regional routing requires a self-managed certificate in Privacy Enhanced Mail (PEM) format with certificate and private key.
Exam tip: Global routing is selected by default unless advanced data residency is enabled, in which case Regional routing is selected by default and cannot be changed.
Lifecycle management and operational visibility in Apigee means keeping a public API stable while backends evolve, onboarding developers efficiently, and watching live traffic for health and usage. Apigee (opens in a new tab) is Google Cloud's native API management platform that builds, manages, and secures APIs through a proxy layer between backend services and client applications. Traffic flows from client applications to the API proxy and then from the proxy to backend services, so producers can change implementation without breaking consumers.
A stable API interface isolates API consumers from backend service changes and enables lifecycle management without disruption. The API proxy functions as a mapping from a publicly available HTTP endpoint to a backend service, so the client only needs the proxy URL, request parameters, credentials, and response format. When a backend changes, such as moving hosts, changing a database, or updating service code, requests still flow from the client to the same proxy endpoint and then from the proxy to the new backend implementation.
Apigee supports REST, gRPC, SOAP, and GraphQL architectural styles through the same proxy layer, which gives producers flexibility across platforms and devices. Policies for security, traffic management, rate limiting, quotas, caching, and mediation execute at the proxy level, so the underlying backend services can remain unchanged. Because control lives in the proxy layer owned by API producers, operations teams can apply consistent behavior across all services while development teams iterate on backends independently.
The developer portal is the integrated publishing surface where API producers onboard API consumers with discovery, documentation, and registration. Client app developers interact with the portal to complete onboarding without direct coordination with backend teams:
This flow moves from publishing by the producer to self-service consumption by the developer, which keeps client apps compatible as services change. Producers retain ownership of the API definition and portal content, while consumers gain ease of use through well-designed, discoverable, and documented endpoints.
Operational visibility in Apigee comes from combined analytics, monitoring, and security services that observe traffic passing through the runtime. All API traffic passes through and is processed by containerized runtime services, and Google Cloud services provide identity management, logging, analytics, and metrics for that traffic. Producers use these signals to confirm availability, control usage, and understand adoption:
Measurability closes the lifecycle loop because monitoring data flows from the runtime back to producers for decisions on scaling, quota changes, and new versions. When usage or error patterns indicate strain, producers adjust proxy policies or backend capacity while consumers continue calling the same stable endpoint.
Exam tip: The API proxy isolates consumers from backends, so backend changes do not interrupt clients as long as the public proxy interface remains consistent.
Mediation and performance optimization is the practice of placing a managed layer between clients and backend microservices so client-facing APIs stay stable even when backends are slow or overloaded. Apigee (opens in a new tab) acts as that mediation layer, receiving client requests, processing them through distributed gateway components, and routing them to backend services. Because API performance depends on both Apigee and the backend systems, optimization focuses on decoupling the two sides through protocol handling, request control, and response caching to lower latency and protect backend capacity.
The Apigee gateway decouples clients from backends by handling all traffic through a consistent request and response path. The client never calls the backend microservice directly; the gateway accepts the request, applies mediation processing, and forwards it to the appropriate backend. This separation lets development teams change backend implementations without changing the client-facing API, as long as the gateway contract stays the same.
An API request routed through Apigee follows an ordered path:
Because the response must traverse the gateway in both directions, a slow or overloaded backend directly increases end-to-end latency even when the gateway itself is healthy.
Protocol transformation in the mediation layer lets older clients connect without requiring backends to support every protocol version. Apigee Istio Ingress Gateway endpoints do not support HTTP/1.0 directly, so an HTTP/1.0 client cannot connect to those endpoints alone. When an HTTP(S) Load Balancer is placed in front of the Apigee Istio Ingress Gateway, the flow changes to support those clients.
Traffic flows from the external HTTP/1.0 client to the load balancer, and the load balancer accepts the HTTP/1.0 connection and automatically converts it to HTTP/1.1 or HTTP/2 when forwarding the request to the Apigee backend service. In this design the load balancer sits outside the Apigee runtime boundary and the Apigee backend sits inside it, so protocol compatibility is handled at the edge rather than in each microservice.
A slow backend (opens in a new tab) is an antipattern where backend systems cannot keep up with API demand after being exposed to many end users through APIs. Many backends were not sized or tuned for that extra demand, so traffic spikes stress CPU, load, and memory or simply take too long to produce a response. Apigee offers tunable options to manage a slow backend, but those options have limitations and cannot replace fixing the backend itself.
| Backend problem | Cause | Impact on API traffic |
|---|---|---|
| Inadequately sized backend | Backend lacks CPU, memory, or capacity for API-driven demand and is stressed by traffic spikes | Increase in traffic leads to failed requests |
| Slow backend | Backend is improperly tuned and responds very slowly to incoming requests | Latency increases, with premature timeouts and degraded customer experience |
An inadequately sized backend fails under load, while a slow backend delays every request that depends on it. Both problems propagate through the mediation layer because the gateway must wait for the backend before it can return a response to the client.
Exam tip: An inadequately sized backend causes failed requests under spikes, while a slow backend causes increased latency and timeouts; response caching helps both, but the underlying backend problem must still be resolved.
Response caching in Apigee stores backend responses so repeated requests can be served without calling the backend again. The cached response flows from the gateway directly to the client, which improves API response times and reduces load on the backend server. Caching is most valuable for repeatable reads where the backend result does not change on every call, because it lowers both latency and backend resource consumption.
Mediation also protects backends by controlling excessive load before it causes failure:
Rate limiting also helps control cost, because project-level quotas for specific resources limit the billing that a project can incur for those resources. Together, caching reduces normal backend load while throttling and early drops preserve availability during abnormal load.
Routing choices in Apigee determine where traffic enters, how far it travels, and which backends receive it. For external access, Apigee creates a Layer 7 global external load balancer to forward traffic to the runtime, and the access routing location controls failover behavior. Choose Global routing when the goal is high availability and automatic failover across all regions, where API requests automatically reroute if one region fails. Choose Regional routing when traffic must stay in the same region as the Apigee instance, which is recommended for organizations with data residency requirements.
Connectivity and backend selection further shape performance. Network Service Tiers (opens in a new tab) Premium Tier moves internet traffic onto the high-performance Google network at the point of presence (PoP) closest to the sender, routes it within the Google network to the Google Cloud resource such as a Compute Engine VM, and sends outbound traffic back out through the PoP closest to the destination. This path reduces the number of network hops between users and the nearest PoPs, which improves perceived availability for globally distributed users with multi-region backends. For traffic between application tiers, such as between web and application tiers in a 3-tier stack, an internal load balancer provides reliable communication without exposing that traffic to the internet.
Health checking ensures that optimized routing only sends traffic to backends that can respond. Load-balancing health checks route application traffic only to responsive backends, even when infrastructure appears healthy and all VMs hosting the application are in the RUNNING state but application software on some VMs has crashed. If backends are managed instance groups (MIGs), autohealing adds another layer where unavailable VMs are proactively deleted and new VMs are created, so capacity is restored without manual intervention.
request.queryparam.apikey variable against an API product and returns a fault instead of forwarding the request when the key cannot be resolved.API key validation in Apigee is a proxy-level check that allows only registered consumers with a valid key to reach a backend API. Traffic flows from the client application to the Apigee API proxy, the proxy resolves the request.queryparam.apikey variable against an API product, and only validated requests flow from the proxy to the backend service. If the key variable cannot be resolved, the proxy returns a fault such as steps.oauth.v2.FailedToResolveAPIKey instead of forwarding the request, and validation requires that the API product include the API proxy and that a developer be created and registered with that product to obtain a key.
Graceful degradation keeps a system working with reduced performance under high load instead of failing completely and then resumes full function when load drops, while circuit-breaking drops all traffic during overload. Apigee supports graceful degradation through throttling where each replica independently slows incoming requests during high-traffic times and frontend throttling drops excess requests early to protect backend components.
Choose Global routing when high availability across regions is needed and advanced data residency is not enabled, because it provides global load balancing with high availability and automatic failover across all regions where API requests automatically reroute if one region fails. Choose Regional routing when data residency must keep traffic in the same region, because load balancing is restricted to the same region as the Apigee instance.
Response caching in Apigee stores backend responses so repeated requests can be served from the gateway directly to the client without calling the backend again. This improves API response times and reduces load on the backend server, which is most valuable for repeatable reads where the backend result does not change on every call.
An e-commerce company is modernizing its application architecture. External web and mobile clients communicate using public RESTful HTTPS APIs with JSON payloads. However, the internal backend microservices have been developed using high-performance gRPC over HTTP/2. Additionally, heavy read traffic for product catalog data is placing unnecessary load on backend services and increasing response latency for end users.
You need to advise the development and operations teams on an API mediation and performance optimization strategy that decouples the clients from backend services, performs protocol translation, and minimizes backend load.
Which architectural solution should you recommend?
Refactor backend microservices to natively serve REST/JSON over HTTP/1.1 and disable service discovery and connection pooling.
Deploy direct proxyless gRPC client libraries onto all external client devices and configure Cloud Service Mesh using xDS name resolution.
Implement an API management mediation layer (such as Apigee) that exposes RESTful JSON endpoints to clients, translates requests to gRPC backend microservices, and applies response caching policies for read requests.
Configure a Passthrough Network Load Balancer with TCP health checks to route client JSON requests directly to backend gRPC container endpoints.
Last updated