Tuesday, April 12, 2011

Simply SaaS (Part 2)

This is part two of a multi part series where I will talk about what it means to develop and deliver a Software-as-a-Service application. I'll be trying to strike a balance between the technical aspects of bringing an app into the cloud and the advantages of using the SaaS approach as an Independent Software Vendor (ISV). I am NOT an expert in SaaS by any means...I'm writing this to educate myself and hopefully any reader that has the same curiosity. Your mileage may vary.

In Part 1 I provided a general overview on what it means to develop and deliver a SaaS application. In this post I will outline an example application and discuss the infrastructure I will be using to deploy my app into the cloud. This discussion should demonstrate the benefits of why SaaS applications are awesome from the perspective of a developer and a business owner (ISV). 


Since the intent of this series is to talk about SaaS (and not about original ideas for future SaaS applications) I didn't put a lot of creative thought into my example. The premise of the application is pretty simple...we are going to take the ASP.NET MVC Movie Tutorial (let's call it MoviesAndYou) and add the ability for brick-and-mortar movie rental stores to communicate with their customers. I decided on this example because I wanted to build a .NET application using the ASP.NET MVC framework and I also wanted an opportunity to try out Apprenda's SaaSGrid Express product. The application will have two types of users:

  1. Let's call the first user Fred Film. This guy loves movies and uses MoviesAndYou to manage a list of movies that he has watched. Fred rates each movie he watches and likes to rent his favorite movies frequently from his local store. Fred doesn't want to pay for the MoviesAndYou service.
  2. The second user will be Ralph Rental. Ralph owns several movie rental stores (as in brick-and-mortar) near Fred. Ralph would like to let his customers know the availability of the movies in his stores so that the customer can reserve the movie online and pick it up in store. Ralph sees the value in having an online reservation system but cannot afford to pay a large upfront fee for this service.

Seem easy enough? Ralph will be paying monthly for the online reservation system. Each store he owns can be thought of as a traditional software license seat. To start, Ralph will introduce the system in one store and then expand to include other stores as he realizes an increase in business from the online reservation system. For the sake of this example we'll pretend that brick-and-mortar rentals stores still exist!

From the ISV's perspective, MoviesAndYou is going to be a single web application. Roles will be used to delineate between consumers and brick-and-mortar users. The data for all users will be stored in a single, logical database. From my last post we know that the SaaSGrid framework will take care of co-mingling the database records so that the developer doesn't have to worry about setting up a new database instance each time a new brick-and-mortar customer subscribes. With SaaSGrid you're able to bring new customers online with a few clicks of the mouse - no messy deployment/configuration scripts. Additionally SaaSGrid provides the infrastructure for metering and billing of your application (that will be covered later). At the end of the day the ISV can focus on the functional aspects of their application instead of stressing out over infrastructure.


We have the business case laid out for the application and we also have our technology selected. To get started developing with SaaSGrid we need a place where we can install the framework. Since I don't have a spare server laying around, I thought this would be a great opportunity to get my feet wet with an Amazon EC2 windows instance.

Getting Started with Amazon EC2
I found the signup process to be straightforward enough for EC2 that I'm not going to cover that here. Once I had my account setup I selected a Windows Server 2008 with SQL Server Express + IIS instance to deploy to. Once you complete the sign up process and select the appropriate AMI you'll need to login to the EC2 console to access your instance. From here you're able to get the connection details that will allow you to remote desktop into your instance and start the install of SaaSGridExpress.


Before you get started installing SaaSGrid make sure you can successfully connect to the SQL Server Express service. At the time of this writing, the SQL Server Express service is set to 'Manual' by default and is not running out of the box. Open up the Server Manager and browse through the Services MMC and set all of the SQL Server Express services to start automatically. I wasn't able to get the SQL Server Agent to start but found that it wasn't necessary to have a successful install of SaaSGrid. With all of the services running, open up SQL Server Management Studio and connect to the .\EC2SQLEXPRESS instance using Windows Authentication. Once you've done that then move on to installing SaaSGrid.

Installing SaaSGridExpress on Your EC2 Instance
The installer for SaaSGrid will first validate your EC2 instance to ensure that all of the necessary services are in place for the framework to operate. Don't be surprised if this process finds some issues with your configuration - a 'repair' button is provided in most cases where the minimum requirements aren't met. Also be aware that some of the repairs will require you to restart the server. 


After validation, the actual installation will take place. Since I'm using an inexpensive EC2 instance (in other words it doesn't have a lot of horse power) the install process took a fair amount of time (approx. one hour). Once the initial install has completed, you'll be prompted to install the administrative tools and SDK.


Finally, even though I didn't receive any warnings during the install I was getting a 500.21 error when trying to view any of the SaaSGrid related apps deployed to IIS. Not to worry, Apprenda has a pretty active developer community. I searched for the error and found this post. Since the fix described there assumes .NET 2.0 I had to update the command to run in .NET 4.0 - also note that you'll need to navigate to the Framework64 folder if the EC2 AMI you selected is 64-bit.




Note: It was my experience that if you need to re-install SaaSGrid be sure to perform a complete uninstall before going through the installation process again. For some reason I didn't have any luck with the 'reinstall' feature.


Now we are all setup to build our application. In the next post I'll take a look at the SDK provided by SaaSGrid...

No comments: