You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Andrew Clute <an...@OSN.state.oh.us> on 2003/07/29 17:09:18 UTC

Single cache across multiple web applications?

As we are moving forward in trying to standardize our Business Domain Model,
the prevailing thought is to have a central 'Core' framework that includes
our BusinessObjects and using OJB.

So, we have a collection of BO's that can be used across lots of different
disparate web applications, and the goal is to have all of the web
applications 'feeding' off one cache -- with the benefits being obviously
cached objects, and data being fed across all of the web applications
instantly.

However, in my test, and this does makes sense, every web application you
create that uses OJB created it's own cache collection, with it's own
reference to objects. So, obviously, any changes made in one web app's cache
will not be apparent in the other's cache, unless the second app goes to the
database -- thus removing the benefit of using the cache.

As anyone else dealt with this type of scenario?

The immediate answer to me is to create a single application that is the
DataService that holds the cached objects, and handles the the OJB
interface, and returns to any of the calling web applications a reference to
the business object. Or, is this a good use of some EJB's to transfer these
objects back and forth -- but then don't I have to worry about my client
applications using a 'copy' of the original data-object, and changes made to
the original cached objects will not be populated to the client applications
-- seems like a breeding ground for out-of-sync errors.

Sorry, if this seems to be a novice question, but I can't seem to get my
head wrapped around a best practice for this type of scenario.

Thanks!


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Single cache across multiple web applications?

Posted by Jason McKerr <mc...@nacse.org>.
You really have two options:


1) Wher I work, we use load-balancing/clustering/failover scenario for
our larger applications including OJB systems.  On those systems, the
cache has to be synchronized across computers, so we use distributed
caching (works through multicast networking).  Currently you can use
either Tangosol (Expensive) or OSCache 2.0 Beta for distributed
caching.  I think there is a class file in the latest releases Contrib
package for Tangosol, and I just recently posted a class for using the
current release of OSCache with OJB.

This doesn't exactly fit your scenario of feeding off of one cache, but
each OJB instance's cache is synched with the others in the cluster. 
This gives you the added benefit of failover at the cache level.

1) On the other hand, you can create a centralized data object layer, (a
la EJB's) through which all data passes, and that'll work ok, although
you'll need to make your OJB objects remotable.  In this case you need
to either make your objects accessible through something like RMI or Web
Services.  I've done layers like this both ways, and it'll be ok, as
long as your aware and have planned for security issues, networking
issues (firewalls? performance? whatever).


If you use distributed caching, you'll need to handle concurrency,
probably through optimistic locking, which OJB does quite well.

Jason


On Tue, 2003-07-29 at 08:09, Andrew Clute wrote:
> As we are moving forward in trying to standardize our Business Domain Model,
> the prevailing thought is to have a central 'Core' framework that includes
> our BusinessObjects and using OJB.
> 
> So, we have a collection of BO's that can be used across lots of different
> disparate web applications, and the goal is to have all of the web
> applications 'feeding' off one cache -- with the benefits being obviously
> cached objects, and data being fed across all of the web applications
> instantly.
> 
> However, in my test, and this does makes sense, every web application you
> create that uses OJB created it's own cache collection, with it's own
> reference to objects. So, obviously, any changes made in one web app's cache
> will not be apparent in the other's cache, unless the second app goes to the
> database -- thus removing the benefit of using the cache.
> 
> As anyone else dealt with this type of scenario?
> 
> The immediate answer to me is to create a single application that is the
> DataService that holds the cached objects, and handles the the OJB
> interface, and returns to any of the calling web applications a reference to
> the business object. Or, is this a good use of some EJB's to transfer these
> objects back and forth -- but then don't I have to worry about my client
> applications using a 'copy' of the original data-object, and changes made to
> the original cached objects will not be populated to the client applications
> -- seems like a breeding ground for out-of-sync errors.
> 
> Sorry, if this seems to be a novice question, but I can't seem to get my
> head wrapped around a best practice for this type of scenario.
> 
> Thanks!
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org