locked
3 Tier Application Architecture possible with Azure? RRS feed

  • Question

  • Hi I have been assigned a task of converting an existing 3 Tier application (Presentation Layer, Business Layer and Data Layer) to an Windows Azure Project.

    Basically what I did was create a Web Role and put the presentation layer in it then I created 2 separate class library(respectively being the Business and Data Layer) projects and linked them to the presentation layer using references.

    However when I deployed the application in Azure only the Web Role (Presentation Layer) was uploaded :/

    Can someone tell me if:

    1. It even is possible to use a 3 tier architecture with azure
    2. If i made a mistake in referencing the projects
    3. If this cannot be achieved is there a similar architecture that is like 3 Tier.

    Thanks!

    Thursday, February 23, 2012 10:30 AM

Answers

  • Hi adrianbon,

    First you need to know the difference between a layer and a tier:

    • A layer is a logical organization of your code like you can see in your screenshot. You have a layer that handles the presentation (ASP.NET), then a layer for business logic (your BusinessLayer project) and a layer for data access (your DataAccessLayer project).
         
    • A tier on the other hand is physical, ie. where your code runs. You could have the presentation tier, being the server that hosts your ASP.NET application. Besides that you could have the application tier, being a server with IIS containing a WCF service (that uses your BusinessLayer and DataAccessLayer assemblies). And finally you could have your data tier: a server running SQL Server.

    Now in your Azure architecture you'll need to evaluate if you'll need this kind of layers and/or tiers:

    • If you use multiple layers, did you make sure your setup is scalable? How do queues fit in your layered architecture? ...
    • Is having multiple tears worth the cost? Would you really need a web role (hosting your presentation layer) and an worker role (your application tier hosting the business and data layers)? It might be more cost effective to have all layers in 1 tier (in your web role) with an other data tier (being SQL Azure).

    But to answer your question, you could use 3 tiers but you'll need to work with more than one role.

    Sandrino

    • Proposed as answer by Sandrino Di Mattia Thursday, February 23, 2012 12:02 PM
    • Marked as answer by adrianbon Friday, February 24, 2012 8:43 AM
    Thursday, February 23, 2012 12:02 PM
  • Hi adrianbon,

    Could you try explicitly including the assemblies in your package?

    • Go to the CartConsoleCloud project
    • Open the References folder
    • Select the references BusinessLayer and Common
    • In the properties window, set Copy  Local to true

    This will make sure the assemblies are deployed to Azure. 

    PS: You could activate Remote Desktop for testing purposes to verify if everything was deployed correctly to your instances.

    Sandrino

    • Marked as answer by adrianbon Friday, February 24, 2012 8:42 AM
    Thursday, February 23, 2012 3:31 PM

All replies

  • I'm not an azure expert, but what you have is perfectly possible.

    And also, what you have there is a couple of dlls that live in one tier - a web role. A separate dll doesn't mean a separate tier.

    Thursday, February 23, 2012 11:54 AM
  • Hi adrianbon,

    First you need to know the difference between a layer and a tier:

    • A layer is a logical organization of your code like you can see in your screenshot. You have a layer that handles the presentation (ASP.NET), then a layer for business logic (your BusinessLayer project) and a layer for data access (your DataAccessLayer project).
         
    • A tier on the other hand is physical, ie. where your code runs. You could have the presentation tier, being the server that hosts your ASP.NET application. Besides that you could have the application tier, being a server with IIS containing a WCF service (that uses your BusinessLayer and DataAccessLayer assemblies). And finally you could have your data tier: a server running SQL Server.

    Now in your Azure architecture you'll need to evaluate if you'll need this kind of layers and/or tiers:

    • If you use multiple layers, did you make sure your setup is scalable? How do queues fit in your layered architecture? ...
    • Is having multiple tears worth the cost? Would you really need a web role (hosting your presentation layer) and an worker role (your application tier hosting the business and data layers)? It might be more cost effective to have all layers in 1 tier (in your web role) with an other data tier (being SQL Azure).

    But to answer your question, you could use 3 tiers but you'll need to work with more than one role.

    Sandrino

    • Proposed as answer by Sandrino Di Mattia Thursday, February 23, 2012 12:02 PM
    • Marked as answer by adrianbon Friday, February 24, 2012 8:43 AM
    Thursday, February 23, 2012 12:02 PM
  • A bit off question - in case of a web application, is the browser (client), running javascript, considered to be a tier as well?

    Thursday, February 23, 2012 12:11 PM
  • Hi thanks for your reply! To answer your question this is a multiple layer application. I was trying to put all layers in 1 tier (the web role) but when i deployed it the application did nothing in terms of functionality (error messages on invalid login etc.) meaning that just the web role with the presenation layer project was deployed.

    If you take a look at the screenshot you can see that there are multiple porjects. What i did was click on the each project and right click on References > Add Reference > Goto the Projects Tab > Select the project that i want to reference. The following was done:

    • The 'BusinessLayer' and 'Common' were referenced to the 'CartConsoleCloud'.  
    • The DataLayer and Common  and Utilities were referenced to the Business Layer
    • The Common was referenced to the DataLayer

    Do you think that i missed any step that may prevent the projects from being deployed? My aim to acomplish this so I can use one role for all layers with use one instance. 

    Thursday, February 23, 2012 12:28 PM
  • Hi adrianbon,

    Could you try explicitly including the assemblies in your package?

    • Go to the CartConsoleCloud project
    • Open the References folder
    • Select the references BusinessLayer and Common
    • In the properties window, set Copy  Local to true

    This will make sure the assemblies are deployed to Azure. 

    PS: You could activate Remote Desktop for testing purposes to verify if everything was deployed correctly to your instances.

    Sandrino

    • Marked as answer by adrianbon Friday, February 24, 2012 8:42 AM
    Thursday, February 23, 2012 3:31 PM
  • Thanks!
    Friday, February 24, 2012 8:42 AM
  • Yes. you can refer the project logic architecture just like any other web application.

    Sunday, February 26, 2012 8:28 AM