File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Scalability Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Scalability" Watch "Scalability" New topic


Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 208

here is an interesting topic :-)

i'm developing an application that has a sender and a listener, but there could be multiple listeners, and there could be millions of users, how best to design the system for scalability using JMS and databases? any ideas or links?


Alok Kushwah
Ranch Hand

Joined: Jul 10, 2007
Posts: 31
Seems like you can implement this using JMS topic destination. Sender can send message to topic and listner can subscribe to listen message published on topic. By this way resposibilty of scalabilty will be trasffred to JMS topic provider or Application server. But while designing system you must decide the quality of service which is realiabilty/persistence which will in turn affect scalabilty of system. JMS implemantation internaly uses DB for persitence.

It would not be good idea to use database for this. You have to design your own notifiaction system to notify the listener in case new message comes. It would be really bad if listener have to poll the database for new messages.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Would those millions of users be "senders" or "listeners"?

As Alok says, I'd leave the storage aspects for the JMS to worry about.
Alok Kushwah
Ranch Hand

Joined: Jul 10, 2007
Posts: 31
Multiple sender and multiple reciever can use same JMS topic. For scalability don't allow durable subscription. Which helps in minimize the use of resources at JMS server. So million of reciever will get the message if they are subscribed to topic and connected at the time of message publication. Millions of sender can send/publish messages to the topic, no problem .
I agree. Here's the link:
subject: Scalability
jQuery in Action, 3rd edition