2

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 :/

My current 3 tier architecture that isnt working properly with azure

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!

adi bon
  • 301
  • 2
  • 6
  • 16

3 Answers3

1

Azure can do this. The question is are you tiers logical or physical. If they are logical, just different assemblies added to the one web project it is very easy, just install it in a web role. If they are physical tiers, ie you business layer is WCF services, this is also possible and it could be hosted in a different web or worker role or even all in the one web role if you wanted.

Craig
  • 36,306
  • 34
  • 114
  • 197
1

About missing reference: You would need to set "copy local to true" for every reference you add to your project by yourself. This way all these references will be packaged and when deployed to cloud, avaialable to your project.

About Presentation and Business Layer: - Keep in mind if you have Web and workrole role in your application you will get two separate VM running your application the only way you could talk is by usign internal endpoints. When running your application on Windows Azure, think why there is a need to seperate code on two virtual machines (if necessary) because you sure can have a web front end as well as background processing code in a web role.. A worker role is nothing but a VM without pre-configured IIS. Most of non .net application with web front end use Worker role as their front end so you shoud need to design your application carefull to choose what will go in web role and what in worker role.

0

Azure is nothing more than a collection of Windows Server 2008 machines. You can deploy your solution as you like. Normally a webrole is used for the web tier (frontend), and a worker role for the logic (backend). You database or datastorage is the last tier.

Peter
  • 27,590
  • 8
  • 64
  • 84
  • So what you are saying is that my Presentation Layer has to be a Web Role, my Business Layer has to be a worker role and my data layer (which connects to SQL Azure) has to be another worker role, then I connect them together through refernces? – adi bon Feb 23 '12 at 10:42
  • You can connect them with the Azure service bus/ WCF / Azure queues or any other communication channel you can think of. – Peter Feb 23 '12 at 10:45
  • It doesn't 'HAVE' to be a seperate worker role at all. A Web role is just a VM with IIS installed. You can run background processes, windows services...anything you'd run on a traditional server all in one role. If you're referencing that data layer in your web project, the data layer DLL will be deployed with the site. You then point your connection string to SQLAzure (or any web-available SQL Server) and you're off to the races. – Matt Quinn Feb 23 '12 at 11:34
  • i orignally did this but only the web role was deployed the other refernced class libraries were not deployed – adi bon Feb 23 '12 at 12:16
  • @adibon - you're confusing 'role' with 'class library.' Windows Azure just runs Windows Server VM's. You choose what to put in them. In your case, you put up a web application and referenced a few class libraries. Those class libraries are being deployed with your web app. That's why you're only seeing one 'role.' – David Makogon Feb 26 '12 at 20:30
  • hi david i have managed to successfully implement a 3 layer application on azure.I basically put my presentation layer in a web role and then I put my business layer with my data access layer in a worker role. All is up and running well! – adi bon Feb 28 '12 at 09:49