ASSOCIATE-CLOUD-ENGINEER practice question 34 of 35
You are designing an application that uses WebSockets and HTTP sessions that are not distributed across the web servers. You want to ensure the application runs properly on Google Cloud Platform. What should you do?
Full set: 332 questionsThe application's design, which uses non-distributed HTTP sessions and WebSockets, requires that all requests from a single client are consistently sent to the same backend server. This is known as session affinity or "sticky sessions." Google Cloud offers several load balancing solutions, and their support for session affinity and the WebSocket protocol varies. For example, the External HTTP(S) Load Balancer supports both WebSocket proxying and multiple types of session affinity (e.g., generated cookie, client IP). Therefore, the critical first step is to evaluate and select the correct load balancer configuration to ensure the application's stateful nature is properly handled.
B. Redesigning the application is a significant architectural change. The immediate problem can be solved with the correct infrastructure configuration (a load balancer with session affinity) without rewriting the application.
C. While encryption is an important security consideration, it does not address the core functional requirement of routing stateful connections to a consistent backend, which is the cause of the problem.
D. Converting WebSockets to another technology is a major development effort that does not solve the separate, but related, problem of non-distributed HTTP session affinity.
1. Session Affinity: Google Cloud documentation for External HTTP(S) Load Balancing states
"Session affinity sends all requests from the same client to the same backend VM or container
as long as the backend is healthy and has capacity." This directly addresses the need for non-distributed sessions.
Source: Google Cloud Documentation
"Session affinity overview
" Section: "Session affinity types".
2. WebSocket Support: The overview for External HTTP(S) Load Balancing explicitly lists WebSocket support as a feature. "The load balancer can proxy WebSocket traffic with no configuration required... If you use WebSockets
the session affinity feature should be enabled to route requests for a particular session to the same backend."
Source: Google Cloud Documentation
"External HTTP(S) Load Balancing overview
" Section: "WebSocket proxy support".
3. Load Balancer Selection: The choice of load balancer is critical for application functionality. The "Choose a load balancer" guide helps users select the right product based on requirements like traffic type
global vs. regional needs
and protocol support
which is the process implied by option A.
Source: Google Cloud Documentation
"Cloud Load Balancing overview
" Section: "Choose a load balancer".
Keep practicing
Take the free ASSOCIATE-CLOUD-ENGINEER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other ASSOCIATE-CLOUD-ENGINEER practice questions
- Question 1You need to verify that a Google Cloud Platform service account was created at a particul…
- Question 2You are building a new version of an application hosted in an App Engine environment. You…
- Question 3You need to create a new billing account and then link it with an existing Google Cloud P…
- Question 4You want to configure 10 Compute Engine instances for availability when maintenance occur…
- Question 5You need to create a custom VPC with a single subnet. The subnet’s range must be as large…
- Question 6You significantly changed a complex Deployment Manager template and want to confirm that …
