wood burning stoves 2.0*
The moose likes Servlets and the fly likes distributed application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "distributed application" Watch "distributed application" New topic
Author

distributed application

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Is it good idea to distribute application on two application servers?

Say, one application server is performing some authentication/validations and then other application is performing actual business functionality.

How to maintain such application?

Thanks.
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
This kind of architecture called N-Tier architecture.

I worked in an application that had 2 application servers. The first application server host JSP/Servlet/JSTL, while the second hosts EJB. First application server takes care of view to users, server site validation, authentication, session management, filters, etc. Second application server hosts EJBs that perform complex business logic and interact with database.

Remote lookup of EJB is meant for this kind of situations.


My blood is tested +ve for Java.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Chetan Parekh:
This kind of architecture called N-Tier architecture.

I worked in an application that had 2 application servers. The first application server host JSP/Servlet/JSTL, while the second hosts EJB. First application server takes care of view to users, server site validation, authentication, session management, filters, etc. Second application server hosts EJBs that perform complex business logic and interact with database.

Remote lookup of EJB is meant for this kind of situations.


Thanks Chetan.

Any advantage of doing this? :roll:
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

You can design an application as being homogenous (multiple nodes running the same code) or hetrogenous (multiple nodes running different code) and a mixture of these. Depending on how many parts you plan to cut your application into (and increase complexity) you may find that some parts require dedicated hardware or servers (eg a Fax gateway) or you may find that it makes sense to co-locate some pieces closer to the database. There are other considerations such as the need to maintain state, communication between machines, areas with different security requirements and the like.

Taking all of this into account it is easy to over architect a system and in my view it is typical to have one or more web servers in a DMZ (medium security area), possibly with a hardware load balancer, then one or more machines in a higher security area serving the business tier, then a dedicated database server in high security. This is obviously not the only solution, but given how cheap hardware is becoming it is easier to throw money at hardware than at the development, maintenance and configuration of an infinitely configurable application.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Separating logical architecture tiers onto physical boxes has some pros and cons. To the good, you can size and tune the two boxes independently. To the bad you have relatively slow network communications between them, complexity on both ends of a remote call and maybe some deployment challenges.

Another way to use two servers is to deploy identical content to both and distribute client requests between them for load balancing and redundancy. To the good, if one fails the other keeps running. You may be able to do hot deployments to one server at a time with minimal interruption to the users. To the bad, or at least the challenging, you have to take a lot more care in state management or at least session management. And you may want special hardware just to do the distribution of work.

Any of that spark more questions?
[ October 12, 2006: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
 
subject: distributed application