Welcome to MSDN Blogs Sign in | Join | Help

ToddHa's WebLog

Musings, notions, thoughts about technology and software.

News

  • Disclaimer
    The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
At the Derek Zoolander Center this week...

This post serves as somewhat as an intro into what a 3-tier architecture is and why it's used.

Why is this important? Most enterprise applications these days are written in the three tier architecture form.

And why the title? Zoolander is one of my favorite movies of all time.

Most enterprise applications these days are built into the three tier architecture form. The three tiers are :

  1. Internet (green)
  2. Presentation (blue)
  3. Application (orange)
  4. Data (red)

But wait. That's 4 tiers? You are correct. But forget about the green parts. The enterprise doesn't maintain those pieces.

(For the sake of simplicity, I'm leaving out firewalls, routers, etc. Any time you see a black arrow, assume that it includes a firewall, even between the tiers. Also, this diagram assumes that you want your "service" accessible from the Internet.)

Let's take an example to see things more clearly. Say that "Contoso" provides an e-mail service called ContosoMail.

A client opens up their internet browser and enters http://www.contoso.com. Lets say they log in, then they go to their inbox. The request to open the inbox gets tunneled through the Internet and eventually it gets to the web server. The web server is sitting on the presentation tier. This is the only tier that is exposed to the Internet. This way clients cannot directly access anything on the application tier or the database tier. Why? Besides security, the web server knows how to speak to the application level in it's language. Even most if not all thick clients (i.e. clients that aren't in web browsers) talk to a "translator and authentication" service on the presentation tier.

The applications on the application tier can be BizTalk, Windows Workflow, or any other application which provides a service. The web server is basically a translator for taking what the client wants, and putting it into a something that the application can understand. The web server can also do all of the authentication things, making sure that the person that makes the request is really the person they say they are.

So the Web Server authenticates the client and says to the application, "Hey, this guy who I've already authenticated wants his inbox."

Once the application hears this message, it says to the database, "Hey, I need the first 50 messages from this user's inbox."

The database goes off, finds the most recent 50 e-mails that are that user's inbox, assembles them, and gives them back to the application. The application gives those e-mails back to the web server, who formats them into a nice looking web page, and gives them back to the client.

This example is very basic. The application doesn't do much and the database doesn't do anything really special. But hey, it's a v1.0 product.

So now that we have our example, what is the advantage of a three tier? Well for one, what if you want to change how the webpage looks to the user? You only need change the web server code. What if you want to change your web server from IIS 6.0 to IIS 7.0? Again, you can change the web server and it has no effect on the application or database. You can be sure that your application will work the same.

Well, what if you want to upgrade your application? Say when a user gets their inbox, you want to show them the first 75 messages instead of just 50. Well, you can go and create a copy of the application, change the code from 50 to 75, and deploy this new version of the application. You can have both running at the same time while the old one is in use.

Say you want to do a complete overhaul of the service. This requires database changes, application changes, and web server changes. Well, you can add a new database to the data tier with all your new features. You can then create and deploy a new application which also has all of your new features. You can do this while your users are currently using your old version. The last step is to build a new website and upgrade the web server.

You can do everything in pieces without ripping everything down first.

 

Note the Wikipedia link to the Three Tier Architecture is here.

Posted: Sunday, March 04, 2007 7:24 AM by toddha

Comments

No Comments

Anonymous comments are disabled
Page view tracker