Re: WebObjects: share data between instances
"Pierce T. Wetter III" <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
On Jun 8, 2006, at 7:45 AM, Kristof Cossement wrote:
> Hi all,
>
> Is there a way to share data between 2 instances of the same
> application?
>
> For instance: I have a java queue (or array) that should be
> processed by both instances of the wo application.
> Can the queue be shared between the 2 instances ?
Yes.
The challenges are:
1. Insuring mutually exclusive access when you want to modify the
queue. That is, if you have two instances processing the queue, then
you don't want them working on the same item...
2. Whether this is one machine or several. If its several, you
need to be able to synchronize over the network, which makes it even
more work.
For a work queue, there are lots of subtle problems to deal with,
because if instance 1 starts working on work unit A, then crashes,
work unit A needs to go back in the queue not sit around forever in
the "pending" state.
Where to go from here:
RMI
memcached
think about having a 3rd master instance that manages the work
queue.
keeping the work queue in the database, since databases already
support network synchronization, locking, etc. Since EOF lets you
talk to multiple database vendors, this could even be very fast
because you could setup a Frontbase instance on each app server with
clustering support just to hold the work queue.
Pierce
WOTip: To use Ajax, you need to understand Javascript, HTML, the DOM,
and how requests work. After that, the WO part is easy.
More Tips: http://www.twinforces.com