Advice needed, please!
tomyoung67 Feb 25, 2003 5:15 PMHi all:
I'm currently in the process of deciding whether to use EJB or not for my new project. My web page uses JSP to generate dynamic web pages and it uses JavaBean to talk to a backend database server to issue all kinds of SQL statements such as select/insert/update etc.. I feel this kind of design (without using any EJB) will serve the purpose. However, the potential users of the Web page are huge. I'm concerned about the "scalability" problem. My questions are:
1) Will my web application run into trouble if the number of users increases to a certain point?
2) Will I not have the same problem if I use EJB instead? If so, I can use a session bean instead of a JavaBean to issue the same set of SQL statements. However, I don't see much of a difference between the two approaches. For example, after I have instantiated a session bean in the JSP web page, I call methods defined in the remote interface to issuing all kinds of SQL queries/updates. The methods I call are exactly the same as those defined in the JavaBean. The only difference is that one is defined in a JavaBean while the other is defined in a session bean. So if I make this change and I can say "I am now using EJB", will that solve my problem of "scalability" if I have any? As I said above, I am very concerned about my web application running into trouble when the number of users increases to a certain point. Will the design without using EJB inherently be vulnerable to this trouble? Will the design using EJB (such as session bean) be immune to this trouble or at least be easier to deal with this trouble? Could someone please give some specific scenarios to help me understand the difference between the two?
3) It is said that "EJB design is N-Tired and N-Tiers allow you to redistribute load more efficiently". In my case, how do I re-distribute the load if needed? I can put the database server on a different machine than the one running the EJB application server to distribute the load, but the same thing can be done with the JSP/JavaBean (with EJB) design, i.e., I can put the database server on a different machine than the one running the servlet engine such as TomCat. I know EJB has lots of advantages. But I may not need them in this project. The "scalability" problem is really what will determine whether I should "to EJB or not to EJB". Could someone please give me some advice? Thanks in advance!
Tom