graphql-engine icon indicating copy to clipboard operation
graphql-engine copied to clipboard

docs: improve streaming subscriptions docs regarding sticky sessions requirement

Open meetzaveri opened this issue 2 years ago • 2 comments

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 avatar Sep 07 '22 20:09 meetzaveri

@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 avatar Sep 07 '22 20:09 coco98

@coco98 Yes agree, like we can utilize a "note" section and add it there.

meetzaveri avatar Sep 08 '22 04:09 meetzaveri

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

krisiye avatar Jan 19 '23 21:01 krisiye