Managing session state among servers

 

All the load distribution techniques discussed in this book rely, on one level or another, on using multiple copies of an appserver and arranging for multiple consecutive requests from various clients to be serviced by different servers.

If each client request is completely independent of every other client request, then it does not matter if two requests are ever processed on the same server or not. However, in practice, there are many situations where all requests from an individual client are not totally independent. In many usage scenarios, a client makes one request, waits for the result, then makes one or more subsequent requests that depend upon the results received from the earlier requests.

Such a sequence of operations on behalf of one client falls into one of two categories:

Stateless: The server that processes each request does so based solely on information provided with that request itself, and not based on information that it "remembers" from earlier requests. In other words, the server does not need to maintain state information between requests.
Stateful: The server that processes a request does need to access and maintain state information generated during the processing of an earlier request.

Again, in the case of stateless interactions, it does not matter if different requests are being processed by different servers. But in the case of stateful interactions, we must ensure that whichever server is processing a request has access to the state information necessary to service that request. This can be ensured either by arranging for the same server to process all the client requests associated with the same state information, or by arranging for that state information to be shared and equally accessible by all servers that may require it. In that last case, it is often advantageous to arrange for most accesses to the shared state to be performed from the same server, so as to minimize the communications overhead associated with accessing the shared state from multiple servers.

This consideration for the management of stateful interactions will be a factor in many discussions of various load-distribution techniques throughout this book. It also requires the discussion of a specific facility, the session management facility, and of server affinity.

  Prev | Home | Next