In a distributed environment, managing a session typically uses the following three ways:
First,session Replication mode management (that is, session replication)
Summary: Copy the session data broadcast from one machine to the rest of the machine in the cluster
usage Scenario : Fewer machines, less network traffic
Advantages : Simple implementation, less configuration, no impact on user access when a machine is down in the network
disadvantage : Broadcast replication to the rest of the machine when there is a certain degree, bring a certain network overhead
Second,Session Sticky mode management
Summary: the sticky session, when the user accesses a machine in the cluster, forcing all subsequent requests to fall on this machine
usage Scenario : Moderate number of machines, not very demanding stability requirements
Advantages : Easy to implement, easy to configure, no additional network overhead
disadvantage : The network has a machine down, the user session will be lost, easy to cause a single point of failure
Third, centralized cache management
Introduction: The session is stored in a distributed cache cluster on a machine, when the user access to different nodes, first take session information from the cache
usage Scenario : Multiple machines in a cluster, complex network environment
Advantages : Good reliability
Disadvantage : the implementation of complexity, stability depends on the stability of the cache, session information into the cache should have a reasonable policy to write
Application scenarios and advantages and disadvantages of three kinds of session management methods in distributed environment