File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes  Why do we require a web server and an application server? 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 " Why do we require a web server and an application server?" Watch " Why do we require a web server and an application server?" New topic
Author

Why do we require a web server and an application server?

Vinay Singh
Ranch Hand

Joined: Dec 15, 2004
Posts: 174
Hi friends
Its been recommended that an ideal architecture for a medium to big sized web based application is supposed to be
--Firewall
--web servers (e.g. Apache)
--firewall
--app servers
--Database

It would mean that deploy the application in two parts, .war file and .ear file, all web related activies on web server and then all the ejb stuff's,business processing and other things on app server.

Can we discuss here the benefits and complexity with this kind of architecrure not just w.r.t assignment but real world also?


Vinay


Technical quiz and interview questions   SCJP 6 mock practice test
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
This is a general J2EE architecture question, so you have a better chance of initiating some interest in the J2EE forum. Transferring this thread there....


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
Hi Vinays,

One reason why I don�t personally like this architecture is because it might impact your application�s performances pretty badly. To be more precisely I�ll tell you that separating the web app and ejb container (and having separate war and ear) will make impossible for your servlets or jsp to access the ejbs via their local interfaces. Therefore every client call will result in at least one remote call form the presentation layer to the business layer. Therefore one needs to design the application using kind of command design pattern strategy in order to reduce the number of calls from one layer to another. This will tide the application design to the system architecture as well.
On the other hand this architecture provides very strong security capabilities. Even more this is exactly the kind of requirements that advocate the need of using an ejb container. So I suppose the answer is somewhere in between: if all deployed applications were initially designed for this kind of hardware architecture, it might be an excellent solution. However it might not be the most optimal configuration for deploying all type of applications.
Regards.


I think, therefore I exist -- Rene Descartes
Vinay Singh
Ranch Hand

Joined: Dec 15, 2004
Posts: 174
Hi Valentin
I am facing the same problems and as an architect or solution designer we might need to justiy why this is ok and why not.I have got some points on this from net and would like to share with all

Reasons to add a web tier
1) Buffering stream input (data coming from the brower) - this is important for applications with different speed / quality client connections (e.g. dial-ups vs. DSL).

2) Buffering stream output (data going back to the browser) - this is even more important for applications with different speed / quality client connections - you don't want to waste a thread in your app tier waiting on data to get acked through a dialup connection.

3) Connection buffering and throttling (lots of incoming connections) - the handling for these conditions is often more efficient and more graceful in a web server; why waste your app tier resources handling this?

4) SSL - assuming you don't hardware accelerate it in your hardware load balancer, it's typically much more efficient to handle the SSL in the uber-scalable web tier than in the app tier.

5) Security - there can be a firewall between the web tier and the app tier, and a firewall in front of the web tier, and only one port (assuming no ssl) open in either firewall.

Are these valid and are there some more like this ?

Cheers
Vinay
 
 
subject: Why do we require a web server and an application server?
 
Similar Threads
What is the role of Web Servers?
what is the actual use of application servlers and web servers?
scea_part_II: What is the purpose of the two web server s?
Making a port listen
VPN