How do I know whether my application needs persistence?
Short answer
The decisive question is where the application keeps the user session. If the session is kept in the server's own memory or on its disk, the user must always go to the same server; that is, Persistence is enabled on the vService. If the session is kept in a shared store such as Redis or a database, or in a token on the client (e.g. JWT), each request can go to any server and persistence is not required. Users dropping out of their session, the cart emptying or multi-step operations being left unfinished while more than one server is active are typical signs of a persistence need; which server the requests go to is seen in the Backend Service column of the HTTP Logs screen.
Signs
| Symptom | Possible meaning |
|---|---|
| Users randomly drop out of their session, a new login is requested | The session is local to the server; requests go to different servers |
| The shopping cart or form data is lost | The same cause |
| "Invalid session", CSRF token errors | The token is generated on one server and validated on another server |
| A multi-step operation or a file upload is left unfinished | The steps land on different servers |
| The problem does not exist while a single server is on, and starts when a second server is added | The strongest sign of a persistence need |
How to Verify?
- HTTP Logs: On the HTTP Logs screen of the vService, the Backend Service column shows the server that answered the request. If it is seen that successive requests of the same user go to different servers and that the error occurs at this switch, persistence is required.
- L7 TCP: The server columns on the TCP Logs and vService Sessions screens are checked.
- Test: New Cookie is temporarily enabled on the vService (Edit → Details → LB algorithm box → Persistence → Save); if the problem disappears, the cause is missing persistence.
- To be asked to the application team: Where is the session kept? Is it shared between the servers?
What Is Selected in Which Case?
| Application | Recommendation |
|---|---|
| Stateless microservice, session in a shared store | None (default) |
| The existing web application generates its own session cookie | Current Cookie |
| New web application | New Cookie |
| API Gateway / REST clients | Hash (header-based key) |
| Cache / CDN layer | Hash (URL-based key) |
| Sessions need to be monitored and moved before maintenance | Session Affinity Manager (SAM) |
| L7 TCP vService | None or Hash |
| Network vService | L4 Persistence |
The table is based on the scenario recommendations in the docs.
Common Misconceptions
- "Turning on persistence is always safe." It is unnecessary in stateless applications and disrupts the balanced distribution of the load (best practices).
- "It is also required with a single server." If there is a single Backend Service, all requests already go to it.
- "Persistence also preserves the session when the server goes down." If the server becomes unavailable, the user goes to another server; the session is preserved only if it is kept in a shared store.
How it is done in the documentation
