users
[Top] [All Lists]

Re: [cinjug-users] Messaging At the Web Layer

To: CinJug <users@xxxxxxxxxx>
Subject: Re: [cinjug-users] Messaging At the Web Layer
From: "Edward Sumerfield" <esumerfd@xxxxxxxxxxxxxx>
Date: Wed, 24 Oct 2007 14:46:34 -0400
Delivered-to: mailing list users@xxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:reply-to:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; bh=JtLNdi3+0fp2rS5S7QaMKyHcswM6foUNAAUmBpGAwPQ=; b=iBBH2QsbZHSyfhoDMkEvpL6LWbf1X2V7h6+cLu4yKwu1jBfc+t14ycojGnwoPem3yALXya8ZofNMws8paj1bHL9frbgmyMOu8rDNinzT1AM20Y9gMQ07rk9lf5XAW57Uu9l3tmN4zLtbA3HdOK4YBDjZqU2q3b3qZZAVGr+QQXs=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=rDhXqkxsGXTSntFz+b1pys2ASkcI3yKPLRvx45rC7Kgx79t9zz3p3TzVcswyGVrMpDH4Tr0Qu4Wx2QuDACFRNVTOPHkcNidjfUVWpqKmCNO5iMtiTojGgS4nsPaXON2bYB/1aHa8E04WZDJG/vN2ChdT75iQJge/tFugi3Wjpyw=
In-reply-to: <471EC2B1.7010308@xxxxxxxxxxxxxxxxxxxxxxx>
Mailing-list: contact users-help@xxxxxxxxxx; run by ezmlm
References: <6a216ba20710231235h730074f7ma164455e7bb8307a@xxxxxxxxxxxxxx> <1e5a35690710231243x1bafa16bm8bdff997274a39f3@xxxxxxxxxxxxxx> <6a216ba20710231342s6eefc439qfad56bd3269143dd@xxxxxxxxxxxxxx> <471EC2B1.7010308@xxxxxxxxxxxxxxxxxxxxxxx>
Reply-to: esumerfd@xxxxxxxxxxxxxx
Sender: esumerfd@xxxxxxxxx
The volume represents at least one change every second but not to all the data.

All Google Earths render the same thing.

The initial "data changing" MDB must only run on one node in the cluster. We could separate the data change MDB from the "invalidate cache" MDB so that we can have a queue to business logic and then a topic for the "invalidate cache". I wonder if using messaging for cache invalidation is an efficient prospect. Presumably existing distributed caching solutions would be tuned for this purpose.

Since not all the data is changing we would only have to invalidate a small part of the cache. I know hibernate can do this at the object level in its session cache but am not sure if that feature propagates to an integrated cache library.

Thanks for your help everyone.

On 10/23/07, Mike Mills <mike@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
You mention that you are using Hibernate, so it seems to me that your
MDB would just need to grab your Hibernate Cache object and clear it?
For clustering, you would do the same thing using topics (message sent
to each container in the cluster.)

Other ideas also come to mind, but it is hard to say without more
information.  From what I've read, you have multiple Google Earth users
requesting up-to-date KML file(s) from your server application.
However, it isn't clear whether the KML is per-user or the same for
everyone.  Also, it isn't clear how often the KML is actually updated
(you say that the polling from Google Earth is frequent, but how often
do changes occur?)  If changes are frequent (which would invalidate the
cache), then I might want to consider the possibility of eliminating
database access from the web application.  Related to this, if the data
is specific to each user, then you wouldn't want to clear the whole
cache on a user-specific update.  So lots of ideas come to mind, from
choosing an appropriate cache provider for Hibernate, to pushing
(background-generated) static content to the web server, etc.

--
Mike Mills
mike@xxxxxxxxxxxxxxxxxxxxxxx

Edward Sumerfield wrote:
> If you are using the term "business layer" to refer to the EJB
> container then I would have to ask how I should do that?
>
> We are using Spring/Hibernate in our MDB so I wonder if I could
> configure a distributed cache, make the web layer get it's data from a
> session bean and then use normal EJB hosted MDB's to invalidate the
> cache as needed?
>
> On 10/23/07, *josh marotti* < marotti@xxxxxxxxx
> <mailto:marotti@xxxxxxxxx>> wrote:
>
>     I'm no architect, so I am asking this out of curiosity and for my own
>     knowledge :
>
>     Why can't the caching and JMS be pushed down to the business layer
>     instead of the web layer?
>
>     Thanks,
>     Josh
>
>     On 10/23/07, Edward Sumerfield < esumerfd@xxxxxxxxxxxxxx
>     <mailto:esumerfd@xxxxxxxxxxxxxx>> wrote:
>     > I am considering implementing a JMS messaging container at the
>     Web layer.
>     > Tell me I am a fool? :-)
>     >
>     > I have a simple web app polled by a client every second for its
>     data. Not
>     > wanting to hit the database for every client, every second, it
>     is cached at
>     > the web layer.
>     >
>     > Enter JMS. We will be receiving notifications of changes to the
>     database
>     > data via JMS messages. So MessageDrivenBeans, deployed to JBoss EJB
>     > container will receive these messages but what should they do to
>     tell the
>     > cache in the Web container to update.
>     >
>     > It seems my options are to push the cache to a java space
>     somewhere so that
>     > the web layer and the MDB's can access it or to move the
>     messaging container
>     > to the web layer.
>     >
>     > Thoughts?
>     >
>     > Ed

<Prev in Thread] Current Thread [Next in Thread>