What is N-Tier?
page 1 of 1
Published: 25 Mar 2004
Unedited - Community Contributed
N-Tier is an architecture where logic and processing is distributed among logical and physical "tiers". These tiers can be conceptually separate, or physically located on different servers and even in different geographical locations.
by Chris Garrett
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 9488/ 36

What is N-Tier?

What is N-Tier?

N-Tier is an architecture where logic and processing is distributed among logical and physical "tiers". These tiers can be conceptually seperate, or physically located on different servers and even in different geographical locations.

What does that mean to me?

Seperating logic brings several benefits, especially in the key areas for developers, ie. stability, performance, scalability and maintainability. At the most basic it simplifies the implementation in the same way seperating your code into routines and components brings higher maintainability and (hopefully) less bugs. Seperating the logic in this way also allows you to drop in extra power where it is needed, for example additional database boxes etc.

Tiers on my pillow

So we know broadly speaking what N-Tier is about, but how do we recognise this beast? To explain this it is usually easiest to describe what the other popular tiered architectures are, you will have been using one for years without knowing it.

1-Tier : Single Host

The good ol' days where people thought they only needed one computer for the whole organisation meant that you physically had one tier. Logically the functions could well have been segregated, but in most cases this scheme would be considered one tier. Using Microsoft Access on your own unconnected desktop, or a dumb-terminal based system could well be considered 1 Tier also.

2-Tier : Client Server

Client Server was a major buzzword in the early 90's, taking initially dumb terminal applications and giving them a fancy windows-like front end, using PCs with terminal emulators which presented pretty GUIs or later Visual Basic etc front-ends. This situation varies along a spectrum of intelligent client/dumb server to thin client/powerful server. A web browser talking to a web server is an example of a client talking to a server. Here there is presentation logic (presentation tier) happening at the client, and data/file access (data access tier) and logic happening at the server.

3-Tier : Client/Presentation Layer, Business Logic/Process Layer and Data Layer

The most popular architecture on the web currently, mostly taking the form of web browser processing client side presentation in the form of HTML/DHTML, etc, the web server using some scripting language (our fave ASP) and the database server (SQL Server for example) serving up the data. Various solutions move the bulk of the work around, beginners to ASP often have the ASP doing all the work with the database being little more than a data store. More advanced solutions could have the client doing loads of work with browser based scripting and XML data islands, or at the other end of the spectrum the database powering the whole thing with stored procedures.

N-Tier : The above and more

So, finally, we get to N-Tier, and N-Tier is basically "A number of Tiers", usually an expanded model of 3-Tier. If we take the 3-Tier example above, we have a crude (but workable) starting point, but if we need more performance or scalability (which we inevitably do) there needs to be more refinement.

A good place to start is to move logic out of the scripting language. Scripting languages (up .NET anyway) are not "proper" languages and are usually more solutions for fancy templating, that is presentation layer stuff and glue for components. In an ASP scenario, this would mean the ASP keeps everything talking to everything else, presenting the results from COM components methods calculations, which form the business logic Tier. The COM components could be split into "Process" and "Data Access", the data components knowing how to talk to the stored procedures and the process components doing actions on the data. Once you have a Data Access Tier you could consider if this function should be further split, or perhaps distributed using DCOM or Message Queues.

How do you know when to stop?

Unfortunately N-Tier is being bandied around as "The Solution", as you can imagine it is not "The Solution" it is "A Solution". Work from your requirements. You can usually use common sense, 80% of things naturally fall into groups, the remaining 20% is either sorted by what you know works or what the solution requires.

User Comments

Title: Nice   
Name: Ram
Date: 2012-10-03 12:35:45 AM
Nice and Clear
Title: Thanks   
Name: John Dean - Helpdesk Manager
Date: 2010-09-07 5:18:00 AM
Thanks, this had helped my understanding of N-Tier enormously.
Title: Hello Sir   
Name: nilesh
Date: 2009-09-22 3:56:05 AM
Hello Sir i want to learn n-tier architecture deeply will u help mee thanks
Title: Tier Dictionary   
Name: Karthik
Date: 2009-03-16 3:19:19 AM
Good one.

-Karthik, Hyderabad
Title: New to know   
Name: Nimesh
Date: 2006-04-17 6:28:49 AM
U have cleared my vision about N-Tier

Thank U very Much
Title: Just In Time Information!   
Name: Paula
Date: 2005-06-13 5:16:39 PM
As a recruiter, I review hundreds of tech articles a week. This was superb! Great thanks - Paula
Title: Good Article   
Name: Karthik
Date: 2005-03-24 10:09:40 AM
This was a simple, but very informative article. Good one.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-05-23 1:38:53 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search