• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between web server & application server

 
SJ Rao
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone tell me the difference between web server and application server ? If u can quote some examples it will be helpful.
My understanding is that you cannot deploy components in webserver, whereas one can deploy components like EJB in app server. Is my understanding right ?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are several different flavors of servers, and various products blur the lines so it's not always easy to know what's what. I don't think everyone is going to agree on names, but see if this make sense:
A vanilla web server minimially serves static HTML, images or other files. I'd be happy to call that a "web server" or more specifically an HTTP server.
A J2EE servlet container provides the framework for you to run servlets, JSPs and so on. I might call that a "presentation server" just to keep things straight.
A J2EE EJB container provides the framework for you to run EJB stuff: session beans, entity beans, etc. For my money, that's definitely an "application server".
You can architect these things using one vendor product or two or three, on one box or two or three, in one JVM or two or three. Or multiples of any server if you want load balancing and redundancy. The options are dizzying, no? And we left out database servers altogether!
 
SJ Rao
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks James, but does web server also take care of Connection pooling for databases and Resource pooling ?
Eg:- Tomcat is a web server right, so this should be taking care of these isnt it ?
If I take an example of yahoo mail a/c & we assume it uses EJB, it will require both application server & web server isn't it as we cannot deploy components on web server. In that case who takes care of resource management & connection pooling ?
Am I too confused ??
 
Sri Basavanahally
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case, web server takes care of pooling of web components (servlets etc) and app server takes care of EJBs.
If you use an app server, you do not need a web-server. An app server has web containers (Servlets, JSPs, HTML, images, etc) and an EJB container for EJBs. So, depending what is being "served" to the client, one of the containers will come into play, for resource pooling etc.
Does that help ?
 
Bill Dudney
Author
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi SJ,
You can have Tomcat manage a db connection pool for you with a Resource element (you can see the docs on Tomcat for more info and an example in the roller weblogger).
Assuming that Yahoo uses EJB on the back end thena ll the resource mgt and connection pooling etc would be (hopefully) handled in the ejb server and not from the web tier. So you would not need db connections from the web tier (instead you would go through a Business Delegate and probably a Session Facade to get to your EJB's.)
Hope this helps.
 
SJ Rao
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bingo,Thanks all got it
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If you use an app server, you do not need a web-server.

I'm just getting picky with language, but even with an all-in-one product, it can be useful to distinguish these separate components. When we talk architecture, we can say "function x belongs in the servlet container" or "function y belongs in the app server". For example, within the WebSphere family, there is a web server (Apache based), a servlet container, and an EJB container. They could all be in one process, or on separate boxes or JVMs for load balancing or scaling purposes. My current project runs the WebSphere http and servlet parts with a non-EJB app server.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!