Meaningless Drivel is fun!*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Separating web & business tier to increase scalability Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Separating web & business tier to increase scalability" Watch "Separating web & business tier to increase scalability" New topic
Author

Separating web & business tier to increase scalability

Rishi Shehrawat
Ranch Hand

Joined: Aug 11, 2010
Posts: 218

Does separation of web & business tier increase scalability?

I have slightly different opinion on this. I feel that web & business tier should ideally be running in the same JVM. We increase performance & scalability as we do away with remote calls which have a overhead in terms of sending data across network & the serialization de-serialization that needs to happen. Why spend CPU & memory on these activities as these (CPU & memory) are precious resources. If load on application increases I can add additional instances of servers/JVM's which will include both the web & business tier.

The other downside is that by splitting web & business tier I will always need start with at-least 4 boxes to address availability. 2 boxes for web tier & another 2 for app tier. By combining web & app tier I could just start with 2 boxes & then incrementally add as application load increases. So to start with my outlay on hardware will also be less.
Usman Ibrahim
Ranch Hand

Joined: May 19, 2011
Posts: 45
I am also inline with you. The advantages of this collocated architecture are

1. Ease of administration
2. Flexible load balancing
3. optimal performance

I am also reluctant in introducing a http server just for displaying static web pages because the application we are designing is a brand new application and is not an extension to an already existing web application, which was displaying static web pages. More over, we lose the advantages of advanced load balancing policies for accessing the servlets or clustered ejb objects if we use http server in front of web/app server.


OCMJEA; OCA (11g dba); SCJP
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30123
    
150

When we talk about the web tier, are we talking about static pages or the application's servlet layer? If the former, separating them definitely increases scalability (and performance) because the app server has less work to do.

If the later, it is a lot trickier. I think it is better to not separate them for all the reasons listed above. But the question isn't whether it is better. The question is whether it is more scalable. And I think one could make a case for both yes and no without any further context.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Usman Ibrahim
Ranch Hand

Joined: May 19, 2011
Posts: 45
If the former, separating them definitely increases scalability (and performance) because the app server has less work to do.


Provided if there are lots of static pages. What if most of the pages are generated and have to look into business layer to get the data? Its just my understanding, please disagree if I am wrong.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30123
    
150

Usman Ibrahim wrote: What if most of the pages are generated and have to look into business layer to get the data? Its just my understanding, please disagree if I am wrong.

That would be the later scenario where determining scalability is a lot more complication/debatable.
Sharma Ashutosh
Bartender

Joined: Apr 06, 2001
Posts: 346
If web server is meant by HTTP Server- like IPlant, Apache Web Server or IBM Http Web Server. I will always go for a medium to big size enterprise application in which Web server and application server are on different JVMs. There are many advantages:
1) Static content can be present only the Web server and they are better in terms in performance and maintainability.
2) Good design for CDN
3) What if in the future - we want to change the Application Server from JEE to some other technology, these kind of transformations will be easy.
4) Site maintenance activities can be better done in this configuration - using landing page etc...
5) Overall load balancing, controlling the traffic is also better done.


Ashutosh Sharma
SCJP 1.2, SCEA 5, Brainbench certified J2EE Developer, Documentum Certified Professional
Blog : http://scea5-passingpart2and3.blogspot.com/
Rishi Shehrawat
Ranch Hand

Joined: Aug 11, 2010
Posts: 218

Apache & IBM Http Server (built on Apache) are pure web servers that handle HTTP requests & do not run or use a JVM. My original question was regarding separation of web tier & business tier, resulting in servlets/JSP's running on separate JVM & the business tier (EJB's) running in a separate JVM.

I believe that frontending web application with a pure web server like Apache has benefits, some of which you have listed. In addition to what you have mentioned, HTTP server could be used for termination of SSL connections, which means that SSL related processing is offloaded to the web server. The Http server is also used for sticky sessions/session affinity.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Separating web & business tier to increase scalability
 
Similar Threads
do I need more servers?
Server Clustering issues
business delegate and service locator
Criteria for adding servers in a tier
When to not use EJB