views:

560

answers:

5

I am not able to understand which elements are called as first tier, second tier & third tier & where they reside. Can they reside on same machine or different machine. Which tier reside on which machine? How we can identify a particular application as a 2 tier application or 3 tier application. Please explain with example

+2  A: 

Wikipedia explains it better then I could

From the article - Top is 1st Tier: alt text

Dan McGrath
A: 

In a modern two-tier architecture, the server holds both the application and the data. The application resides on the server rather than the client, probably because the server will have more processing power and disk space than the PC.

In a three-tier architecture, the data and applications are split onto seperate servers, with the server-side distributed between a database server and an application server. The client is a front end, simply requesting and displaying data. Reason being that each server will be dedicated to processing either data or application requests, hence a more manageable system and less contention for resources will occur.

You can refer to http://stackoverflow.com/questions/455555/difference-between-three-tier-vs-n-tier/455645

Ravia
A: 

The general explanation is provided in the link from Dan.


For specific questions your ask :

They can reside on the same machine, even in the same process (JVM for Java). It is a logical distinction (what they do?), not a physical one (where they are?).

KLE
+2  A: 

First, we must make a distinction between layers and tiers. Layers are the way to logically break code into components and tiers are the physical nodes to place the components on. This question explains it better: http://stackoverflow.com/questions/120438/whats-the-difference-between-layers-and-tiers

A two layer architecture is usually just a presentation layer and data store layer. These can be on 1 tier (1 machine) or 2 tiers (2 machines) to achieve better performance by distributing the work load.

A three layer architecture usually puts something between the presentation and data store layers such as a business logic layer or service layer. Again, you can put this into 1,2, or 3 tiers depending on how much money you have for hardware and how much load you expect.

Putting multiple machines in a tier will help with the robustness of the system by providing redundancy.

Below is a good example of a layered architecture:

alt text

A good reference for all of this can be found here on MSDN: http://msdn.microsoft.com/en-us/library/ms978678.aspx

LWoodyiii
A: 

Tiers are nothing but the separation of concerns and in general the presentation layer (the forms or pages that is visible to the user) is separated from the data tier (the class or file interact with the database). This separation is done in order to improve the maintainability, scalability, re-usability, flexibility and performance as well.

A good explanations with demo code of 3-tier and 4-tier architecture can be read at http://www.dotnetfunda.com/articles/article71.aspx

Thank you

raja1