graphql-engine
graphql-engine copied to clipboard
docs: improve streaming subscriptions docs regarding sticky sessions requirement
Is your proposal related to a problem?
For streaming PG subscriptions against a pool of Hasura servers (only a single PG) that are behind a single IP proxy/load-balancer, are sticky sessions required?
It looks like the state is on the server which implies yes, but maybe that state is stored in PG so would be shared so they are not needed?
Describe the solution you'd like
We can update the docs to cover this topic under streaming subscriptions.
@meetzaveri I replied on discord as well, but the quick answer to this is that sticky sessions are not required.
Maybe we should make this clear with a line that we add on the docs page for subscriptions and steaming subscriptions.
@coco98 Yes agree, like we can utilize a "note" section and add it there.
It may be good to add some specific documentation around this since the client may still need to handle this gracefully in the event the server/container recycles (update/restart etc) and respond to WebSocket connection events similar to https://stackoverflow.com/questions/67883223/how-to-detect-disconnect-and-reconnect-for-subscriptionwebsocket-in-apollo-cli