Senior
For API Gateway, one Load Balancer, and for WebSocket, another — so two LBs in the system?
sobes.tech AI
Answer from AI
Yes, in a typical architecture, if you have separate services for API Gateway and WebSocket, each can be assigned its own Load Balancer. This is because WebSocket requires maintaining a persistent connection, which differs from the typical HTTP requests handled by API Gateway.
Therefore, the system can have two Load Balancers:
- One for API Gateway, which balances HTTP/HTTPS traffic.
- Another for WebSocket, which supports long-lived connections and can have specific settings (e.g., timeouts, sticky sessions).
This separation helps optimize the performance and reliability of each type of traffic.