Hi All,

Based on the Architecture review of " Tomcat session replication using
caching ", following aspects were discussed.
Participants

   -  Azeez, Sameera , Aruna, Jayanga, Gayashan, SupunM, Niranjan and
   Myself

Proposed solution. - key-val: (CarbonSessionCacheKey, CarbonSessionCache)

   - Initial implementation was based on javax.caching api's. I've created
   CarbonSessionCache and CarbonSessionCacheKey to maintain HttpSession in
   the Hazelcast distributed map. Session will be intercepted by using a
   Tomcat Valve.
   - *Verdict* on the proposed solution. - Cache map Serialization and
   Deserialization is very expensive operation due to heavy traffic. Therefore
   it is not efficient to replicate the whole session object in the cache map.

Counter Proposed solution

   - Having a Hazelcast map per session object. In that way if an attribute
   in the session changes the whole entry should not have to be replicated,
   only the changed attribute.
   - Have a per-session cache - ( session_id ).
   - Issue in this approach as follows
      - How can we acquire the session object from the map ?

*Final verdict *on the feature implementation

   - Instead of using the caching APIs, This needs to fix in
   Hazelcast level and do it in the optimal way. [1]
   - HazelcastWM
   <http://docs.hazelcast.org/docs/1.9.4/manual/html/ch08.html> [2], Bring
   in the filter code level in to the tomcat valve instead

-Pubudu
[1] http://hazelcast.com/use-cases/web-session-clustering/
[2] http://docs.hazelcast.org/docs/1.9.4/manual/html/ch08.html

On Wed, Oct 1, 2014 at 10:51 AM, Pubudu Dissanayake <pubu...@wso2.com>
wrote:

> Hi Srinath
>
> Hazelcast WM allows us to cluster user http sessions automatically.
> Followings are required for enabling Hazelcast Session Clustering
> <http://hazelcast.com/use-cases/web-session-clustering/> [2][3]
>
>    - Target application or web server should support Java 1.5+
>    - Target application or web server should support Servlet 2.4+ spec
>    - Session objects that needs to be clustered have to be Serializable
>
> Purpose of web session clustering is to replicate web session state across
> a distributed application servers. Benefits, allow us to scale out  but
> also avoid any single point of failure and allow us to dynamically handle
> node failure within the application tier. performance of this web session
> clustering is high according to VP Hazelcast
> <https://www.youtube.com/watch?v=8a0LrlOIXq0>. Using Hazelcast session
> replication can be achieved in two different ways. Observations as follows.
>
>    - *Hazelcast Enterprise* has native web session clustering build in to
>    Apache Tomcat.
>    - *Opensource Hazelcast* has provide a web session clustering as an
>    external filter, basically Hazelcast filter has to be placed before all of
>    other filters and that will enable us to provide the web session clustering
>    in opensource. In this use case it doesn't required changes to application
>    itself.
>
> [1] https://redmine.wso2.com/issues/2816
> [2] http://hazelcast.com/use-cases/web-session-clustering/
> [3]
> http://hazelcast.org/docs/latest/manual/html/httpsessionclustering.html
> [4] https://www.youtube.com/watch?v=8a0LrlOIXq0
>
> More info $subject - Web Session Clustering / Session Replication using
> Hazelcast
>
> -Pubudu
>
>
> On Wed, Oct 1, 2014 at 10:41 AM, Srinath Perera <srin...@wso2.com> wrote:
>
>> We need to use Hazelcast
>>
>> When implemented we need to test this with multilple nodes (at least 4)
>> and in high load conditions before it is done done.
>>
>> --Srinath
>>
>> On Wed, Oct 1, 2014 at 8:52 AM, Dinesh J Weerakkody <dine...@wso2.com>
>> wrote:
>>
>>> Hi,
>>>
>>> I came across this project [1] and might be useful. It is based on
>>> memcached library.
>>>
>>> [1] http://code.google.com/p/memcached-session-manager/
>>>
>>> On Tue, Sep 30, 2014 at 8:01 PM, Pubudu Dissanayake <pubu...@wso2.com>
>>> wrote:
>>>
>>>> Hi All,
>>>>
>>>> I am working on an improvement for Carbon to enable tomcat session
>>>> replication support using caching .Our previous implementation was
>>>> based on a Tomcat Valve ( CarbonTomcatSessionReplicationValve.java).And
>>>> it was used to replicate the session and adding it to cluster message.
>>>>
>>>> Http Session replication in carbon works like this (its quite similar
>>>> to how the same work in a standalone tomcat).
>>>>
>>>> 1. Not every webbapp session will be replicated. You need to set a
>>>> context property (distributable) for the webapp you need.
>>>> 2. Once enabled, and when the session is modified on a node, that
>>>> modification is sent to other nodes via a cluster message ( using
>>>> clustering )
>>>>
>>>> For the new implementation, initial suggestion is to use our caching
>>>> implementation. So we need to store the session object in the cache and
>>>> when session is modified, then we need to update the cache.
>>>>
>>>> Please guide me through the process what should I carried out and any
>>>> references to help me further to achieve [1].
>>>>
>>>> [1] https://redmine.wso2.com/issues/2816
>>>> ​
>>>>
>>>> --
>>>> *Pubudu Dissanayake*
>>>>  Software Engineer
>>>>
>>>> WSO2 Inc.; http://wso2.com
>>>> lean.enterprise.middleware
>>>> Mob: + 94 775 503 304
>>>>
>>>> Blog: http://geekdetected.wordpress.com/
>>>> Linkedin: *http://lk.linkedin.com/in/pubududissanayake*
>>>> <http://lk.linkedin.com/in/pubududissanayake>
>>>> Flickr : https://www.flickr.com/photos/pubudufx/
>>>> Twitter: https://twitter.com/GeekInAction
>>>>
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> d...@wso2.org
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>> *Dinesh J. Weerakkody*
>>> Software Engineer
>>> WSO2 Inc.
>>> lean | enterprise | middleware
>>> M : +94 727 361788 | E : dine...@wso2.com | W : www.wso2.com
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> d...@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> ============================
>> Srinath Perera, Ph.D.
>>    http://people.apache.org/~hemapani/
>>    http://srinathsview.blogspot.com/
>>
>
>
>
> --
> *Pubudu Dissanayake*
>  Software Engineer
>
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
> Mob: + 94 775 503 304
>
> Blog: http://geekdetected.wordpress.com/
> Linkedin: *http://lk.linkedin.com/in/pubududissanayake*
> <http://lk.linkedin.com/in/pubududissanayake>
> Flickr : https://www.flickr.com/photos/pubudufx/
> Twitter: https://twitter.com/GeekInAction
>
>


-- 
*Pubudu Dissanayake*
 Software Engineer

WSO2 Inc.; http://wso2.com
lean.enterprise.middleware
Mob: + 94 775 503 304

Blog: http://geekdetected.wordpress.com/
Linkedin: *http://lk.linkedin.com/in/pubududissanayake*
<http://lk.linkedin.com/in/pubududissanayake>
Flickr : https://www.flickr.com/photos/pubudufx/
Twitter: https://twitter.com/GeekInAction
_______________________________________________
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to