Thursday 8 August 2013

How to design an enterprise application with many independent processes?

How to design an enterprise application with many independent processes?

How should I design an application comprised of numerous (but identical)
independent processes that need to communicate data to an enterprise
application and be monitored and accessible by a web interface?
Here's a more concrete example in Java:
The independent processes are multiple instances of a standalone J2SE
application that receives on initialization data about a "user" entity and
then starts doing stuff regarding this "user" (this is an infinite process
and so any batch sort of design would be wrong here and also similarly,
the starting time of these processes is irrelevant)
The enterprise application is a set of J2EE beans and web-services that
implement business logic, DB access etc.. and that are (for example)
hosted on GlassFish.
The web front is a set of JSPs (perhaps also on GlassFish) that work with
the beans.
Now ideally, I want a way for the processes in (1) to be able to invoke
methods from the beans in (2), but also for the beans in (2) to be able
and update the processes (1) about things.
So these are the required flows of executions, assuming there are 10
independent process of (1) running for 10 different users (consider a
"user" something easily identifiable by, say, a number):
Something happens in one of the processes of (1) and they invoke a method
from the enterprise application (2) with some data.
One of the real, human, users (which was already identified by the web
app) clicks something on a web-page of (3), this invokes a method in (2),
and then some "magical" entity (which I have no idea how to name) finds
the independent process from (1) that is responsible for this particular
user and updates the process with some new data.
My best approach so far is to expose these J2SE apps by JMX and go from
there, but I have one thing I don't understand - who or what should be
holding a key-pair list of the sort "the process at URI X is responsible
for user Y" and then directing the calls accordingly.
BTW, please feel free to give any advice outside of the Java platform (!),
as long as it is a platform that can be scaled easily.

No comments:

Post a Comment