Session persistence Meaning
Session persistence (also known as "Sticky Sessions") is a networking technique used in "Load Balanced" environments to ensure that a user’s requests are always sent to the same backend server for the duration of their visit. If an exchange has 50 servers, persistence ensures that when you log in to Server A, your next 10 requests are also handled by Server A, rather than being bounced around to other servers that might not have your session data.This is achieved by the Load Balancer recognizing a "Session Cookie" or the user's IP address.
Persistence is vital for applications that store "In-Memory" data, such as a high-speed trading engine that keeps a local cache of your active orders to provide millisecond-level updates. If your session were to move to a different server that hasn't synced your local cache yet, you might see "Ghost Orders" or incorrect balances, leading to a confusing and potentially costly user experience.However, session persistence creates a "Single Point of Failure" for that specific user.
If Server A crashes, the user's session is lost even if the other 49 servers are running perfectly. To mitigate this, modern "Cloud-Native" fintech apps use "Distributed Session Stores" (like Redis).
This allows for "Stateless Persistence," where any server can pick up a user's session because the data is stored in a shared, lightning-fast database that all servers can access, combining the speed of local memory with the reliability of a distributed system.