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 questions
Answer options
A: Meet with the cloud enablement team to discuss load balancer options. Correct answer
B: Redesign the application to use a distributed user session service that does not rely on WebSockets and HTTP sessions.
C: Review the encryption requirements for WebSocket connections with the security team.
D: Convert the WebSocket code to use HTTP streaming.
Correct Answer:
A. Meet with the cloud enablement team to discuss load balancer options.
Explanation

The 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.

Why Incorrect

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.

References

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".

Scroll to Top