T
Timasmith
Suppose you were designing an app from scratch (I am using Java + j2ee
server but thats neither here nor there) which has a cluster of
application servers, 1000 distributed fat clients and the need to push
events out to the client.
Normally processing is your typically crud access but there are a
number of use cases where it would be rather advantageous to send
business events.
So lets say you are working on a widget and someone else depleted the
inventory. Instead of continuing to work on the widget it would be
nice to be notified of the event so you can beat up on that person.
I can think of a couple of strategies off the top of my head
a) Client application has a thread constantly polling the server for
any new events - say every minute (configurable)
b) Client application has an open socket on the server with a thread
blocking until something is written to the socket.
c) Client application has an open port which the server can connect to
and push events out.
So my thoughts would be
a) Wasteful, with 1000 users perhaps that communication adds up -
regardless if the event queue is stored in the database or in one of
the application servers (or all app servers).
b) Seems like the server might get overloaded with 1000 sockets open.
c) Not bad, perhaps a security concern that anyone could connect to
that port. Server has to efficiently handle clients that disconnected
without telling them.
Any other ideas?
server but thats neither here nor there) which has a cluster of
application servers, 1000 distributed fat clients and the need to push
events out to the client.
Normally processing is your typically crud access but there are a
number of use cases where it would be rather advantageous to send
business events.
So lets say you are working on a widget and someone else depleted the
inventory. Instead of continuing to work on the widget it would be
nice to be notified of the event so you can beat up on that person.
I can think of a couple of strategies off the top of my head
a) Client application has a thread constantly polling the server for
any new events - say every minute (configurable)
b) Client application has an open socket on the server with a thread
blocking until something is written to the socket.
c) Client application has an open port which the server can connect to
and push events out.
So my thoughts would be
a) Wasteful, with 1000 users perhaps that communication adds up -
regardless if the event queue is stored in the database or in one of
the application servers (or all app servers).
b) Seems like the server might get overloaded with 1000 sockets open.
c) Not bad, perhaps a security concern that anyone could connect to
that port. Server has to efficiently handle clients that disconnected
without telling them.
Any other ideas?