• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

EJB cluster

 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello dudes,
I want to make a cluster to handle some "high" laod. Now; my content is 100% dynamic, and user centric (no 2 users will "ever" ask about the same content). I was thinking before to have Apache web server with mod_jk spraying the load to Tomcat-JBoss servers. I don't think I will need Apache since there is no static content, and all the requests will be forwarded anyway.
So now, my questions are:
1- Is it a good idea to have Apache even if the content is 100% dynamic? (more robust and can handle several com without crashing).
2- NOW assuming I will not use Apache/mod_jk, how is the load goin to be distributed, I think that the jboss server could forward the request to another server when the load is high, but to which server will my clients point to (In case I don't want to make any kind of clustering at the client level, and the client needs to know only one IP adress).
3- If the answer to question 2 is an IP balancer (IP sprayer), then you would you need to have your application "cluster" aware, the IP sprayer can just do it for you. I have read that mod_jk is doing fail-over, and I know that many (costly load balancers also detect when a server is down (by healp of some kinda heart beats requests) and takes the request to the next server. They are even session aware and let you continue when you where the other server stopped. Why do would you ever need EJB clustering, at all?
4- For now I don't need any kind of ACID functions and there is no need for EJB transaction capabilities (a function will mostly have reads and might have a single write), and I have an API that gives me some async calls. Is there a need for EJBs (yes I have read all the EJB threads in this forum)
5- The web server usually is put in the same computer and JVM as the application EJB container so that calls from a tier to an other wouldn't make performance problems. Now, since the requests are sprayed accross these applications servers at the web server/load balancer and they also deal with failover and so on, why would you ever need EJB container to sit and take place for your valuable tomcat server? for transactions? and in case Tomcat acts as a client to the EJB layer and can broadcast a request to get saccess to JNDI and search for EJB eobjects, it would not help if they sit together, since if JBoss is dead in a machine, Tomcat in the same machine is probably dead.
6- Any experiance with free software based Load balancers? Any free layer 7 switch software?
Well sorry for the long message,
ANY help will be very very much appreciated.
Thanks in advance
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First let me start off saying that I am not an expert when it comes to Systems Infrastructure. However, I have been involved in enough of these decisions to pick up a few things along the way. Now on to your questions...
1- Is it a good idea to have Apache even if the content is 100% dynamic? (more robust and can handle several com without crashing).
I always use a separate HTTP Server for my applications for two reasons:
1 - Dedicated HTTP Servers offer a lot more options when it comes to things like access control, bandwidth throttling, and IP blocking.
2 - Using a separate HTTP Server(s) allows a greater level of security for your application. The HTTP Server can and should sit in the public-facing DMZ and be separated from your Application Server by another Firewall. A typical setup looks like this (the |'s represent Firewalls):
Internet | HTTP Server | Application Server | Database Server
2- NOW assuming I will not use Apache/mod_jk, how is the load goin to be distributed, I think that the jboss server could forward the request to another server when the load is high, but to which server will my clients point to (In case I don't want to make any kind of clustering at the client level, and the client needs to know only one IP adress).
Like I mention above... you will definitely want to have a dedicated HTTP Server like a Apache in the mix. You will also probably want to put a hardware load balancer in front of the whole thing. Don't forget redundancy for both!
3- If the answer to question 2 is an IP balancer (IP sprayer), then you would you need to have your application "cluster" aware, the IP sprayer can just do it for you. I have read that mod_jk is doing fail-over, and I know that many (costly load balancers also detect when a server is down (by healp of some kinda heart beats requests) and takes the request to the next server. They are even session aware and let you continue when you where the other server stopped. Why do would you ever need EJB clustering, at all?
Why indeed? If you are always packaging the client and business tier together than you really don't need to cluster at the EJB level, you can instead package the whole thing as an ear and just cluster at the Web application level. This is the case for the majority of J2EE Web Applications. However, some applications have distributed clients (Swing Applications, Web Services, etc.) and the EJB tier must be clustered in these cases. Note, that though the load balancers may seems costly, they are just a drop in the bucket compared to the cost of most projects and are definitely worth the investment.
4- For now I don't need any kind of ACID functions and there is no need for EJB transaction capabilities (a function will mostly have reads and might have a single write), and I have an API that gives me some async calls. Is there a need for EJBs (yes I have read all the EJB threads in this forum)
EJBs offers a number of services: Remotability, Security, Persistence, Caching, Messaging, and Transactioning are the main ones. You are obviously not using any Remotability since it seems you are packaging your Web and EJB Tiers together. Then you say that you do not need Messaging or Transactioning. That only leaves Security, Persistence, and Caching. It up to you to decide if those services are worth the extra overhead of EJB. I don't know enough about your application to say for sure either way. However, my gut feeling would say that you probably don't need EJB.
5- The web server usually is put in the same computer and JVM as the application EJB container so that calls from a tier to an other wouldn't make performance problems. Now, since the requests are sprayed accross these applications servers at the web server/load balancer and they also deal with failover and so on, why would you ever need EJB container to sit and take place for your valuable tomcat server? for transactions? and in case Tomcat acts as a client to the EJB layer and can broadcast a request to get saccess to JNDI and search for EJB eobjects, it would not help if they sit together, since if JBoss is dead in a machine, Tomcat in the same machine is probably dead.
First let us be absolutely clear. You are referring to Web Containers... not Web Servers. Secondly, this is really the same question as number 4. When is EJB a good choice? The answer is simply that EJB is a good choice when you can take advantage of the above mentioned EJB Container services. If you can not use those services then EJB is not appropriate for your application. Just like I have mentioned many times in this forum... I personally only like to use EJBs when my applications have heavy transactioning and messaging requirements. I don't find the other services all that useful.
6- Any experiance with free software based Load balancers? Any free layer 7 switch software?
Most J2EE Servers come with plugins for the various HTTP Servers that support load balancing. I do not have any experience with any of the free software load balancers. Though my suggestion is to invest in the best solution available (free or otherwise). Like I mention above, this is a mere fraction of the cost of the entire application and it is one of the most critical pieces.
 
Tonny Tssagovic
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Chris, I don't know what I would have done without you.
PS: I Like free things because this is a school project , If I were rich and had to make the decision, buying one of these expeansive L7 load balancers would probably be an easy choice. Especially if the application is going to be successful enough to require such devices.
 
Yeah, but does being a ninja come with a dental plan? And what about this tiny ad?
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic