Search This Blog

Wednesday, December 16, 2009

Session Persistence

1. Session object cached in memory by server.
2. Session object will be lost if server fails.
3. Two methods to enable persistence and overcome this problem.
· Database.
· Session objects persisted using JDBC data source.
4. DB2 included in WebSphere Application Server package for session persistence.
5. Memory-to-Memory replication.
6. Sessions copied to another server using WebSphere Internal Messaging.
7. Multiple topology models possible:
· Single Replica
· N-way peer-to-peer
· Client/server (Dedicated replication server)
· Can specify when replication performed
· Data transfer between JVMs can be encrypted
· Better performance than database persistence
To support failover, a mechanism is required that enables another server to access the session object if the primary server handling the session fails. WebSphere Application Server V5 supports two methods of persistence:
Database - a database can be configured for session persistence. You can define a JDBC provider and data source and configure this for session persistence in the session manager configuration. Various options are provided to balance performance and recovery in this configuration. Database access is relatively slow, and could slow down activities, but caching helps ease that problem by reducing the number of reads to the database.
Memory to Memory replication is a process whereby in-memory session data can be copied over to another server’s memory. Memory-to-memory replication can use one of three basic topologies - Single replica, peer-to-peer, and client/server. Each has advantages depending on the scenario. When to persist is also configurable - at the end of each request, at a timer interval, or when directed by the application code - which is to say, when the synch() method is called. Memory to memory session replication has all the features that database persistence has (except the database-specific options, like row size) and the traffic can be encrypted. It is available in WebSphere Application Server Network Deployment and editions above this. Session persistence to memory has some performance advantages over database persistence, and scales well.

No comments:

Post a Comment