none
Is the web application a 2-tier architecture? RRS feed

  • Question

  • Hi,

    When I think of 2-tier architecture, I vision 2 computers talking to each other, with one computer being the client and the other being the Server. Now, with this in mind, is it possible to see this web application as a 2-tier architecture.

    Client Machine-> Web Browser

    Server Machine -> IIS web server hosting the website, the machine possibly hosts the database also.

    Is this a 2-tier web application architecture?.

    Now, during web application development using Visual Studio, if I am debugging the website using local IIS and database, will this constitute as a 1-tier architecture?.

    Thanks

     


    Ravi
    Thursday, October 27, 2011 4:33 PM

Answers

  • n-tier-> Your application is distributed among n physical tiers(running on different machines)

    n-layer -> Your application has n logical layers like presentation layer, application layer and data layer etc (need not be running on different servers)

    >Bineesh


    #Bineesh -- Mark best replies as answers please.
    • Marked as answer by RaviAustin Sunday, November 6, 2011 12:17 AM
    Tuesday, November 1, 2011 3:01 PM

All replies

  • Yes, you're right about the 2-tier architecture.  If you have a basic web site and each web page makes requests to a database server directly that's a 2-tier.  3-tier would be if you expanded this and had another server components such as a class library that included business logic (BLL) or a dedicated DAL (data access layer) such as a set of API's to talk to the database that run on the server side. 

    Even if you moved it to one machine though, it would still be 2-tier because you would still have a web server (the web server included in Visual Studio) and the database server.

    The only way it would be 1-tier would be something like a windows application that talks to a local access database or something like that. 


    Tom Overton
    Thursday, October 27, 2011 4:53 PM
  • Tom,

    Thanks for the reply. I am still confused as to what consitutes a tier.  Is tier a machine?.  If yes, for a 2-tier architecture we should have 2 machines connected, client machine and server machine isn't it?. Similarly for a 3-tier architecture there should be 3 machines connected, client-server-server. Am I wrong?.

     

    Thanks

     


    Ravi
    Thursday, October 27, 2011 5:25 PM
  • It really isn't machines, it's more of what your logical layers are.  You can have a multi-tier application running on one machine. 

     For example, if you go into visual studio and create a web application.  Then add 2 class libraries to it.  In one class library create a class that makes ADO.NET calls to the database.  In the other class library, create a Customer class, and create some routines that load this Customer class (or a list of Customer classes) with data using the first class library.  This would already be a 3-tier architecture even on one machine.

    Client-server is more of what you think about in terms of machine -> machine.  Then, you really do need 2 machines.  One is the client that requests information from a server and the server processes the request and sends the results back to the client.  However, how the client goes about logically making the request to the server will be where the 2 tier vs 3 tier comes in.  As far as the server knows, it simply got a request for data.  It doesn't know or care that a BLL and DAL tier was involved, where the other tier's are physically located, etc.   


    Tom Overton
    Thursday, October 27, 2011 5:42 PM
  • Tom,

    I dug through some of the msdn articles, it seems that tiers are actually the physical machines.  Here is a great article

    http://msdn.microsoft.com/en-us/library/ee658120.aspx

    Thanks

     

     

     


    Ravi
    Thursday, October 27, 2011 8:35 PM
  • Yeah you're right Ravi, quite often you hear n-tier and n-layer used interchangably and til this day it still confuses people.  Most of the time each tier is going to be on a separate physical boundry.  n-layer is more about the code separation (such as creating different logical assemblies to handle database access, business logic, presentation, etc.  When each of these are deployed into production, they form the various tiers. 

    The problem with saying 1 machine is 1-tier, 2 machines is 2-tier, etc is that nowdays virtualization has made this thinking obsolete. Each "tier" could consist of many machines or just 1 machine.  This is the trend toward instant scalability and load balancing.   You could even have two machines in one in a virtual environment on a single machine.  At my company we have 2 physical servers but have many "virtual" web servers for example.  So is each web server a tier or should they not be considered a tier because they are on a single machine?  It's open for debate! 

     


    Tom Overton
    Thursday, October 27, 2011 9:22 PM
  • Hi,

    Read the below link will give you clear view about tiers

    http://msdn.microsoft.com/en-us/library/ee658109.aspx#DesignSteps

     

     

    Monday, October 31, 2011 10:43 AM
  • n-tier-> Your application is distributed among n physical tiers(running on different machines)

    n-layer -> Your application has n logical layers like presentation layer, application layer and data layer etc (need not be running on different servers)

    >Bineesh


    #Bineesh -- Mark best replies as answers please.
    • Marked as answer by RaviAustin Sunday, November 6, 2011 12:17 AM
    Tuesday, November 1, 2011 3:01 PM
  • each tier can have n-layers.

    N-Tier

    YourWebsite --> YourWCFservice(for local DB & authentication logics)

    YourWCFService--> XyzBankService(to check user's credit, inaddition doing local DB calls)

    Here YourWebsite & YourWCFService can be in the same IIS(same machine)

     

    N-Layer

    YourWebsite has UI-->Presenter/controler/Business layer-->Service proxy layer

    YourWCFService has ServiceImplementation/Entry-->Business-->DAL-->DB and OtherOusideService Proxy.

     

    Hope you got the difference.

     

    Wednesday, November 2, 2011 10:59 AM