Monday, June 7, 2010

Session Pattern

Following figure shows a scenario where a number of clients accessing a server.

In order to improve efficiency, maintaining a session context makes perfect sense. Data and resources that a client uses repeatitively are held in the memory cache.

This pattern is well-known in web applications and database connection pooling.

Following points characterize this scenario:

1. The linkage is temporary;
2. The server doesn't rely on client issuing a closing message to release session data;
3. Resources and data accessed through the linkage identifier as the key;

This pattern works in the following approach:

1. Clients access server with a unique session identifier as part of the request;
2. The server is preset with a timeout value, which controls when the session to be removed or reclaimed as with pooling;

No comments: