Session failover
Session failover occurs when a client that disconnects from a Diffusion™ Cloud server attempts to connect to a different Diffusion Cloud server that also has information about that client's session.
Differences between session reconnection and session failover
- Session reconnection
- The load balancer forwards the client connection to the Diffusion Cloud server it was previously connected to, if that server is still available. For more information, see Reconnect to Diffusion Cloud.
- Session failover
- The load balancer forwards the client connection to a different Diffusion Cloud server that shares information about the client's session, if session replication is enabled between the servers.
Prefer session reconnection to session failover wherever possible by ensuring that the load balancer is configured to route all connections from a specific client to the same server if that server is available.
Session reconnection is more efficient as less data must be sent to the client and has less risk of data loss, as sent messages can be recovered, in-flight requests are not lost, and handlers do not need to be registered again.
For more information, see Routing strategies at your load balancer.
Session reconnection | Session failover |
---|---|
The client connects to the same Diffusion Cloud server it was previously connected to. | The client connects to a Diffusion Cloud server different to the one it was previously connected to. |
The client sends its last session token to the server. | |
The server authenticates the client connection or validates its session token. | |
The server uses the session token to resynchronize the
streams of messages between the server and client by resending
any messages that were lost in transmission from a buffer of
sent messages. If lost messages cannot be recovered because they are no longer present in a buffer, the server aborts the reconnection. |
The server uses the session token to retrieve the session state and topic selections from the datagrid. |