Skip to main content

Cloud Hosting - Amazon EC2

style="" >So recently I got the chance to deploy my first application to Amazon EC2. 
I've got to say after a little bit of trial and error I think the service is pretty amazing and is definetly the future of web hosting and you sure can't beat the price US $0.125 / Hour which is essentially US $90 / month. Bandwidth between S3 and your Ec2 instance costs nothing so is very attractive for Media Transcoding and other such tasks.
The requirements were as follows:
IIS 6.0
Ideally I would want to host the Application on a Windows Server 2008 instance so that I could leverage the features of IIS 7.0 and also have a dedicated SQL Server 2008 instance, but unfortunately Amazon does not support this yet and it's unclear when this will happen so I had to use a makeshift approach.
To manage your instances you can and should use the Firefox Plugin ElasticFox. It makes it very easy and I didn't have to read the documentation once.
The AMI (Amazon Machine Image) that I used as a base was ami-b13cd8d8
which is a 32-Bit Windows Server 2003 with:
  • IIS
  • SQL Server 2005 Express
  • ASP.NET 
The first thing I did was uninstall SQL Server 2005 Express and then downloaded all the bits and pieces I needed. The download speeds were highly impressive, SQL Server 2008 Express which is about 500MB downloaded in less than 10 minutes and it's cheap too.
Unfortunately I didn't know enough about Data Persistance and the lifetime of Instances and so I saved all the downloads I need on the D:\ that is available on the Instance.
This turned out to be a mistake as when it comes to Bundle your configured instance into an AMI anything on the D:\ is not persisted.
So you have two options, either store any files on the C:\ or use an Elastic Block Store.
Without going into too much detail an EBS is a Logical Drive that you can attach to an instance and in my case is where I chose to store all Application files and Data.
Unfortunately the same EBS Volume cannot be attached to multiple instances, but there is the ability to create a snapshot of the EBS then create a new Volume based on the Snapshot. 
After I had configured my instance sans Application specific files it was time to bundle it into an AMI, this requires an Amazon S3 to store the AMI in.
Leave a comment if you want me to make the AMI public as it will save you a lot of time.
Now it was time to install the Application onto my newly created AMI.
The application itself is an ASP.NET MVC Web Application numerous IIS Hosted WCF Web Services.
As I mentioned I installed all the application specific files on my EBS Volume and set the SQL .MDF and .LDF files to be stored on the volume as well then set up IIS accordingly.
Installing the MVC app on IIS 6.0 requires a little bit of working to make the Routing work, see
for more info. I'm hoping Amazon will introduce Windows Server 2008 soon.
There are a few more things I need to resolve which include:
  • Distributed Cache
  • Multiple Instances
  • Dynamic DNS
  • Load Balancing
All in all I am very impressed with this service and whilst at the moment I am only researching this, I think it can't be ignored.
Next up I'm going to go through the same process with GoGrid.
Windows Azure looks very promising, however without Full SQL Server support it's not particularly useful at this stage as SQL Server Data Services is too immature for a Production system and the cost of changing from an ADO.NET Data Access layer to SSDS is too high at this stage. Also there has been no indication on Pricing or Service Level Agreements so we'll just have to wait and see.
Once there is an SSDS Adapter for Entity Framework then and only then could I consider changing my Data Access Layer. 

Popular posts from this blog

Freeing Disk Space on C:\ Windows Server 2008

  I just spent the last little while trying to clear space on our servers in order to install .NET 4.5 . Decided to post so my future self can find the information when I next have to do this. I performed all the usual tasks: Deleting any files/folders from C:\windows\temp and C:\Users\%UserName%\AppData\Local\Temp Delete all EventViewer logs Save to another Disk if you want to keep them Remove any unused programs, e.g. Firefox Remove anything in C:\inetpub\logs Remove any file/folders C:\Windows\System32\LogFiles Remove any file/folders from C:\Users\%UserName%\Downloads Remove any file/folders able to be removed from C:\Users\%UserName%\Desktop Remove any file/folders able to be removed from C:\Users\%UserName%\My Documents Stop Windows Update service and remove all files/folders from C:\Windows\SoftwareDistribution Deleting an Event Logs Run COMPCLN.exe Move the Virtual Memory file to another disk However this wasn’t enough & I found the most space was

3 Reasons Why Progressive Web Apps (PWAs) Won’t Replace Native Apps

Many people believe Progressive Web Apps (PWAs) are the future of the mobile web, but in my opinion, PWAs are not a replacement for native mobile apps. Here are three reasons why: 1. Native mobile apps provide a smoother & faster experience  Mobile websites, progressive or otherwise are slower and not as smooth. 90% of the time spent is spent using apps vs the browser . The single most significant contributing factor to a smooth experience on mobile is the speed of the network and latency of the data downloaded and uploaded. When you visit websites on desktop or mobile, there is a lot of third-party code/data that gets downloaded to your device, which more often than not has zero impact on the user experience. This includes: CSS (Cascading Style Sheets) JavaScript Ad network code Facebook tracking code Google tracking code The median number of requests a mobile website makes is a shocking  69 . On the other hand, native apps only get the data that is requi

Unit Testing Workflow Activities in .NET 4.0

  Recently during a catch up with my buddy Keith Patton I was (as I tend to do) singing the praises of the Workflow in .NET 4.0. The all important question about Unit Testing support was raised, I tried as best as I could to explain the new In and Out Arguments but I didn’t feel I was convincing enough, so I though I would clarify with a blog post. If you developed Workflows in .NET 3.5 then you will be well aware of the lack of Unit Test support which was due to many reasons but mostly in part to the complex Workflow hosting environment. When moving to .NET 4.0 Workflow Foundation from .NET 3.5 it pays to be conscious of that fact that there is no longer a distinction between Activities and Workflows. Everything derives from the System.Activities.Activity class. So the definition of a Workflow is just a collection of of 1 or more Activities. I have designed a very simple Rental Car Activity which takes the an Applicants age as the input and outputs a True or False depending o