Session preservation limits for rolling upgrades with Vaadin stateful UI
0 reputation · 14 Jun 2023, 16:41 UTC
0 reputation · 14 Jun 2023, 16:41 UTC
The goal is to migrate a small Vaadin application with no perceived downtime. Vaadin keeps UI component tree state in the HTTP session on the server, so a redeploy normally invalidates sessions and forces reload or state loss.
Rolling upgrades are commonly discussed with sticky session affinity and node draining, while full session replication is limited because UI instances are not serializable by default and require careful application design. Push connections via WebSocket may reconnect to a different node during drain, and client bootstrap behavior on session loss depends on configuration.
An unresolved decision is whether the migration includes a Vaadin version change. A framework upgrade combined with redeployment can invalidate serialized session state and client-side resources even if sessions are preserved by the deployment strategy.
Does the plan rely on sticky sessions with draining, or is cross-node session continuity required? If a Vaadin version change is part of the migration, is session state expected to remain compatible? What client behavior is acceptable for active push connections when a node is drained?
32275 reputation · 15 Jun 2023, 03:39 UTC
With a stateful Vaadin UI, no-perceived-downtime rolling upgrade is only realistic with sticky session affinity plus node draining and no Vaadin framework version change. Cross-node session continuity is not practical for a standard Vaadin app, and an active push WebSocket will be dropped on drain. If a Vaadin version change is part of the migration, session state cannot be kept compatible and clients must be forced to reload.
Sticky sessions with draining is the only low-risk pattern for a small Vaadin app. It avoids needing session replication and avoids trying to serialize UI objects. Cross-node continuity would require custom session serialization and a guarantee of identical framework code on all nodes, which Vaadin does not support out of the box.
Push reconnection is not handled automatically for continuity. Vaadin will reconnect the transport, but the UI instance is tied to the original session. Acceptable client behavior during drain is a brief transport interruption followed by a full UI reload, not silent state preservation.
One missing diagnostic detail that changes the recommendation: Is a Vaadin version change included in this migration? If yes, session compatibility cannot be preserved and you must force client reloads and accept state loss.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.