Archive

Monthly Archives: May 2010

I have been in many conversations lately about Software as a Service (Saas) and Cloud Infrastructure & Technology.  In those conversations I have found that there is commonly a mixing of what people think Saas and Cloud actually mean.  In reality, there are two autonomous concepts and Cloud should not be used interchangeably with Saas.

Saas Clarified

Software as a Server, commonly shortened just called Saas is very descriptive of exactly what it means.  With Saas there is a particular software application provided to clients via a service.  That may be a bit confusing, so I will elaborate further.  The software part of this acronym could be a calendar application, a to-do list, expense tracking, or something else.  The delivery of that particular software is then provided by a service such as SOAP or REST Services, or some other transport medium over the Internet or other secure connection.

The other very significant implication of Saas is the process of payments for the particular software or service.  This is the part that is not implied within the name.  Saas is and was created primarily to allow creators of software to provide software based on subscription style payments.  Since the maturity of software applications has reached a certain threshold the industry as a whole has been searching for a mechanism to allow more fluid and measurable means of revenue.  Saas is the model that provides that means.

The Clouds Defined

What is cloud technology, infrastructure, applications, or computing?  The various cloud offerings out there do not always work to provide a good clear definition of what exactly a cloud is.  What I like to think of as the cloud ideal, which fits into most of the definitions is,

"Cloud Computing is Internet computing using shared resources over geographically dispersed areas.  Over these areas, content delivery is provided with resiliency through redundant systems, drives, and other hardware providing a high uptime percentage (99.9% or more)."

Of course, that is my definition with my particular criteria that I feel is important to have for a legitimate cloud.  As I learn and research more about cloud technology, infrastructure, and the ideals behind this model of computing I will most likely get more specific, and possibly add more to my personal definition of what Cloud Computing is.  Also, see my original definition by real examples blog entry.

Cloud and Saas Clarification

The cloud, often used to describe a Saas model is incorrect.  A Saas Business Model can be hosted in any number of cloud infrastructures, but one does not implicitly necessitate the existence of the other.  A Saas Business Application may simply be hosted in a shared environment, or on a single server, partially clustered servers, or otherwise.  Meanwhile a cloud infrastructure setup may not have any Saas Applications at all and instead runs only services between machines.  Simply put, the cloud and Saas don’t particularly have anything to do with each other.  It just happens that they often do.

I was working through some scenarios recently with Azure and Silverlight.  I immediately decided a quick walk through for setting up a Silverlight Application running in an ASP.NET MVC 2 Application would be a cool project.

This walk through I have Visual Studio 2010, Silverlight 4, and the Azure SDK all installed.  If you need to download any of those go get em? now.

Launch Visual Studio 2010 and start a new project.  Click on the section for cloud templates as shown below.

After you name the project, the dialog for what type of Windows Azure Cloud Service Role will display.  I selected ASP.NET MVC 2 Web Role, which adds the MvcWebRole1 Project to the Cloud Service Solution.

Since I selected the ASP.NET MVC 2 Project type, it immediately prompts for a unit test project.  Because I just want to get everything running first, I will probably be unit testing the Silverlight and just using the MVC Project as a host for the Silverlight for now, and because I would prefer to just add the unit test project later, I am going to select no here.

Once you’ve created the ASP.NET MVC 2 project to host the Silverlight, then create another new project.  Select the Silverlight section under the Installed Templates in the Add New Project dialog.  Then select Silverlight Application.

The next dialog that comes up will inquire about using the existing ASP.NET MVC Application I just created, which I do want it to use that so I leave it checked.  The options section however I do not want to check RIA Web Services, do not want a test page added to the project, and I want Silverlight debugging enabled so I leave that checked.  Once those options are appropriately set, just click on OK and the Silverlight Project will be added to the overall solution.

The next steps now are to get the Silverlight object appropriately embedded in the web page.  First open up the Site.Master file in the ASP.NET MVC 2 Project located under the Veiws/Shared/ location.  After you open the file review the content of the <header></header> section.  In that section add another <contentplaceholder></contentplaceholder> tag as shown in the code snippet below.

<head runat="server">
    
    <link rel="stylesheet" type="text/css" href="../../Content/Site.css" />
    <asp:contentplaceholder id="HeaderContent" runat="server">  </asp:contentplaceholder>


i usually put it toward the bottom of the header section.  it just seems the <title></title> should be on the top of the section and i like to keep it that way.

now open up the index.aspx page under the asp.net mvc 2 project located in the views/home/ directory.  when you open up that file add a <asp:content><asp:content> tag as shown in the next snippet.

<asp:content id="content1" runat="server" contentplaceholderid="titlecontent">
    home page </asp:content>   <asp:content id="headercontent" runat="server" contentplaceholderid="headercontent">   </asp:content>   <asp:content id="content2" runat="server" contentplaceholderid="maincontent">
    <h2>&lt;%= html.encode(viewdata[&quot;message&quot;]) %&gt;</h2>
    <p>
        to learn more about asp.net mvc visit <a title="ASP.NET MVC Website" href="http://asp.net/mvc">http://asp.net/mvc</a>. </p></asp:content>

In that center tag, I am now going to add what is needed to appropriately embed the Silverlight obj object into the page.  The first thing I needed is a reference to the Silverlight.js file.

<script type="text/javascript" src="Silverlight.js"></script>

After that comes a bit of nitty gritty Javascript.  I create another tag (and for those in the know, this is exactly like the generated code that is dumped into the *.html page generated with any Silverlight Project if you select to "add a test page that references the application".  The complete Javascript is below.

function onSilverlightError(sender, args) {
    var appSource = &quot;&quot;;
    if (sender != null &amp;&amp; sender != 0) {
        appSource = sender.getHost().Source;
    }   var errorType = args.ErrorType;
    var iErrorCode = args.ErrorCode;   if (errorType == &quot;ImageError&quot; || errorType == &quot;MediaError&quot;) {
        return;
    }   var errMsg = &quot;Unhandled Error
            in Silverlight Application &quot; + appSource + &quot;\n&quot;;   errMsg += &quot;Code: &quot; + iErrorCode + &quot; \n&quot;;
    errMsg += &quot;Category: &quot; + errorType + &quot; \n&quot;;
    errMsg += &quot;Message: &quot; + args.ErrorMessage + &quot; \n&quot;;   if (errorType == &quot;ParserError&quot;) {
        errMsg += &quot;File: &quot; + args.xamlFile + &quot; \n&quot;;
        errMsg += &quot;Line: &quot; + args.lineNumber + &quot; \n&quot;;
        errMsg += &quot;Position: &quot; + args.charPosition + &quot; \n&quot;;
    }
    else if (errorType == &quot;RuntimeError&quot;) {
        if (args.lineNumber != 0) {
            errMsg += &quot;Line: &quot; + args.lineNumber + &quot; \n&quot;;
            errMsg += &quot;Position: &quot; + args.charPosition + &quot; \n&quot;;
        }
        errMsg += &quot;MethodName: &quot; + args.methodName + &quot; \n&quot;;
    }   throw new Error(errMsg);
}

I literally, since it seems to work fine, just use what is populated in the automatically generated page.  After getting the appropriate Javascript into place I put the actual Silverlight Object Embed code into the HTML itself.  Just so I know the positioning and for final verification when running the application I insert the embed code just below the Index.aspx page message.  As shown below.

<asp:content id="Content2" runat="server" contentplaceholderid="MainContent">
    <h2>
        &lt;%= Html.Encode(ViewData[&quot;Message&quot;]) %&gt;</h2>
    <p>
        To learn more about ASP.NET MVC visit <a title="ASP.NET MVC Website" href="http://asp.net/mvc">http://asp.net/mvc</a>. </p><div id="silverlightControlHost">
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
            width="100%" height="100%">
            <param name="source" value="ClientBin/CloudySilverlight.xap" />
            <param name="onError" value="onSilverlightError" />
            <param name="background" value="white" />
            <param name="minRuntimeVersion" value="4.0.50401.0" />
            <param name="autoUpgrade" value="true" />
            <a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=4.0.50401.0" style="text-decoration: none">
                <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:
            none" />
            </a>
        </object><iframe style="border-right-width: 0px; width: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px; visibility: hidden; border-left-width: 0px" id="_sl_historyFrame"></iframe></div></asp:content>

I then open up the Silverlight Project MainPage.xaml.  Just to make it visibly obvious that the Silverlight Application is running in the page, I added a button as shown below.

&lt;?XML:NAMESPACE PREFIX = [default] http://schemas.microsoft.com/winfx/2006/xaml/presentation NS = &quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot; /&gt;<usercontrol xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" d:designwidth="400" d:designheight="300" mc:ignorable="d" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:class="CloudySilverlight.MainPage">   <grid background="White" x:name="LayoutRoot">
        <button name="button1" click="button1_Click" width="75" verticalalignment="Top" margin="48,40,0,0" horizontalalignment="Left" height="23" content="Button">
    </grid>
</usercontrol>

Just for kicks, I added a message box that would popup, just to show executing functionality
also.

private void button1_Click(object sender, RoutedEventArgs e)
{
    MessageBox.Show(&quot;It runs in the cloud!&quot;);
}

I then executed the ASP.NET MVC 2 and could see the Silverlight Application in page.  With a quick click of the button, I got a message box.  Success!ight 4, and the latest Azure
SDK, this is actually a ridiculously easy process.

Navigate to the Azure Cloud Services web site.


Once that is open go back in Visual Studio and right click on the cloud project
and select publish.


This will publish two files into a directory.  Copy that directory so you can
easily paste it into the Azure Cloud Services web site.  You’ll have to click
on the application role in the cloud (I will have another blog entry soon about
where, how, and best practices in the cloud).


In the text boxes shown, select the application package file and the configuration
file and place them in the appropriate text boxes.  This is the part were it
comes in handy to have copied the directory path of the file location.  That
way when you click on browser you can just paste that in, then hit enter.  The two files will be listed and you can select the appropriate file.

Once that is done, name the service deployment.  Then click on publish.  After a minute or so you will see the following screen.


Now click on run.  Once the MvcWebRole1 goes green (the little light symbol
to the left of the status) click on the Web Site URL.  Be patient during this
process too, it could take a minute or two.  The Silverlight application should again come up just like you
ran it on your local machine.

Once staging is up and running, click on the circular icon with two arrows to move
staging to production.  Once you are done make sure the green light is again
go for the production deploy, then click on the Web Site URL to verify the site
is working.  At this point I had a successful development, staging, and production
deployment.

Thanks for reading, hope this was helpful.  I have more Windows Azure and other
cloud related material coming, so stay tuned.

I have tried to explain cloud computing in the past, but it never turns out well if I just explain what it is.  So instead I have a few stories to tell instead, that provide reasons and why cloud model computing exists.  I then have a bit to spin about why cloud computing is the future as well.

The face of the Internet is quickly changing.  It used to be this zit ridden, crude HTML spaghetti, user experience disaster where people would go and wonder aimlessly.  Over time there has come to be a sort of cohesive gathering around certain websites.  The websites have changed from time to time and today these websites include Myspace, Facebook, and Twitter as the premier gathering places.  These sites each have had various amounts of horrendous downtime, lost user data, fail whales, and other fun implosions of their respective services.  These implosions provide great empirical evidence why the Internet has been in desperate need of cloud infrastructure and architecture.

What is cloud computing?  Wikipedia defines cloud computing as

"Cloud computing is Internet-based computing, whereby shared resources, software and information are provided to computers and other devices on-demand, like the electricity grid."

But what do Myspace, Facebook, and Twitter have to do with the cloud?  They have all had massive growing pains over the years.  These pains could have been alleviated with a good simple design in any of the modern cloud infrastructures.

So now, back to the stories of these gathering places on the web.  Myspace kicked off years ago in August of 2003.  The core team of eUniverse Employees copied the then popular Friendster Site.  The company supposedly had server capacity and other resources to spare.  However within a short period of time the site had hit limitations and users began to experience failures all the time.  Anyone that used Myspace during this time knows exactly what these were.  A lot of these issues derived from a not so scalable implementation of ColdFusion.  The errors during system failures were commonly the default errors one would see from a choking non-scalable ColdFusion Server.  It became apparent that Myspace had issues.

The simple fact of the matter was, Myspace was ill-prepared for the growth they were receiving.  The servers became overloaded, and could not feed the page requests in a reasonable amount of time.  The problem was the delivery and timeliness of additional server equipment, the power outages, the ability to redeploy fixes to the software architecture, and a host of other problems that kept resurfacing over and over again.

Facebook got started just after Myspace did.  It didn’t immediately have the same issues, but there were failures along the same lines.  One of the ways Facebook managed to hide some of the issues was to control the growth of its user base more.  In addition their architecture was a little ahead of the curve of growth.  But still, even with experiences of others to learn from, Facebook still ran into growth issues a number of times.

Again, the hardware and software were not able to be altered for scalable growth fast enough.  The users of the service got pages that weren’t available and the list of issues grew.  Eventually, Facebook grew itself a cloud of its own.  Just as Myspace had out of necessity.  They grew infrastructure that tied hardware and software together into a cloud of sorts, albeit it was too late to have alleviated the initial problems.  The main thing though, Myspace and Facebook have eliminated the vast majority of their problems by creating this type of infrastructure.

Now one may think, "Oh those nerds must have it down now, surely another high growth service wouldn’t dare not build directly into a cloud environment of some sort!"

WRONG.

Along comes Twitter in 2006.  Obliviously bounding along into the Internet.  At first it went almost unnoticed.  Around 2008 though this service started to have some heavy growth.  At this time a funny thing happened, the fail whale surfaced and blew its spout!  Immediately users took notice, and at first it became a laughable joke if one got the fail whale.  As time went by, and growth started to rapidly accelerate though the whale came back more and more frequently.  Often times users found it annoying, cursed the very existence of the poor fail whale, and became indignant about the beast from the sea of Twitter.

What had Twitter failed to do?  They failed to plan or scale appropriately.  They failed because they didn’t setup an appropriate infrastructure.  They failed because they didn’t use a cloud model.  It really is as simple as that.  Sure there are tons of excuses, like those given by Twitter that Om Malik quotes, "Twitter is, fundamentally, a messaging system. Twitter was not architected as a messaging system, however. For expediency’s sake, Twitter was built with technologies and practices that are more appropriate to a content management system."

Excuses, excuses, excuses.  Refactor, rebuild, redeploy.  Oh wait, it is harder than that because they didn’t build for the cloud.

To the point around what cloud computing is.  It really doesn’t matter.  What one needs to know from a business and user perspective is what problems it gets rid of and what power it gives us all.  The cloud has massive potential to remove almost entirely all of the issues that Myspace, Facebook, and especially Twitter has had.

Cloud Systems, within the infrastructure itself are the resources to handle systems that sites like Myspace, Facebook, and Twitter need.  Within good software architectural practices there are the solutions to get software built right for the cloud.  Within the components that put the software and hardware together the ability to deploy regularly, with accuracy, and almost zero downtime (maybe minutes per year) are available.  Going from development to staging to production are no longer a huge process as it has been in the past.

Now the real challenge is to get businesses to make smart architectural decisions about those systems and get them moved into the cloud!  If your site is intended for high capacity usage on the web or enterprise and legal restrictions don’t stand in your way, this really is a no-brainer for any new startup.  Why would future sites want to go through the same embarrassment, especially when just starting out!

Ok, so maybe it is a cloudy topic.  There are a zillion reasons to use an RDBMS (Relational Database Management System).  SQL Server, Oracle, and a number of others are well built, can handle huge numbers of transactions, and have great data integrity.  However as Dare Obasanjo asks on his blog, Building Scalable Websites:  Are Relational Databases Compatible with Large Scale Websites? It brings to bare an important question which so far has been answered time and time again, “no”.  However there are still some that argue that it does scale, such as Dennis Forbes Getting Real About NoSQL and the SQL-Isn’t-Scalable Lie.

Being RDMBSs don’t scale horizontally is where large web sites have their issues.  Myspace, Facebook, Digg, Twitter, and others when put under the pressure of their scalability requirements, have thrown away their primary RDBMSs for various NoSQL Alternatives.

Some still argue that RDBMSs can hold under the weight of large sites, and it seems like they should with hundreds of gigs of memory, SAN arrays, and other hardware offerings.  However one would find it nearly impossible to find any horizontally scalable offerings in the RDBMS camp that can handle millions of users (such as those sites mentioned above have) on a consistent and reliable basis.  The drives get thrashed, the transactions get queued and lost, or worse data never even gets to the RDMBS because of the way the RDBMS Architecture works.  Even Dennis Forbes admits, “Such a platform can yield very satisfactory performance for tens or hundreds of thousands of active users in most usage and application scenarios (where generally clients talk to a farm of middleware servers).” Which leaves me asking Dennis, “so what about when your site reaches millions of users?  The Enterprise Corporate world rarely reaches that, but the Internet Consumer world has gotten there a number of times already, what’s the solution?”

Simple fact of the matter is, it is rare to impossible to find the hardware, price point, and technical architecture combination that would allow an RDBMS handle millions of users.  I won’t rule it out in the future, but right now these systems just do not scale to that volume.

Webtrends doesn’t use RDBMSs for Web Analytics

A first hand experience I have with RDMBSs failing to handle what is and needs to be provided is at Webtrends.  At Webtrends we had tried (more than just we, engineers at the company far before I was there) had tried to cram the massive volume of transactions, processing, and other data into an RDBMS.  Why?  Simple, RDBMSs are easy to develop against.  However, the RDBMS just couldn’t handle the volume.  In the meantime flat file, object, and document databases (NoSQL) have provided an alternative that works.  So I fail to see how an RDBMS can actually handle the volume of data of massive systems such as Webtrends or the aforementioned sites.

Microsoft Azure provides a real bridge

One might ask themselves, “Well I have an RDBMS now and it is growing into realms that it soon won’t be able to handle, where stands a solution?”  Microsoft provides several options that step into the void to fill the gap (and yes, there are other cloud solutions, but nobody provides as many options as Azure does at the moment).

The first option is an RDMBS called Microsoft SQL Azure.  Now you might think, “wait a second, you have just been griping about RDBMSs just like the NoSQL crew does”, which is true.  But one of the major uses of the Microsoft SQL Azure relational database service is to provide a basic starting point to migrate or at least start a cloud based application.  I wouldn’t suggest in a cloud environment one builds to a relational database unless there is a very solid reason.  Again, the relational database is stuck with horizontal growth restrictions, which is one of the primary reasons Microsoft currently keeps the SQL Azure instances to a 1 or 10 GB limit.

(As I wrote this, I wasn’t aware of but realized while searching the links that Amazon actually has relational data services now ? i.e. RDBMS in the cloud also)

The second option is the Microsoft Azure Storage.  The storage can be blob, tables (not like RDBMS tables), or queues.  The combination of these features enables one to build massive horizontally scalable data stores.  Which removes the single machine, horizontal scalability issues of RDBMSs.

Ok, ok, ok, now I am sounding a bit like a shill

So let me drag into this write up the rough spots.  Sure, the horizontal scalability of the storage mechanisms is practically endless compared to an RDBMS.  But then we run into the ease in which to get data.  Questions come up such as;

  • How do I query my data storage?
  • How should I store my data?
  • How should I design it along with the other options?

So yes, there is significantly more architecture to build around alternatives at this point.  RDBMS Systems have plenty written around the existing options, but the NoSQL Alternatives and the storage that is available in the cloud (Azure, AWS, Google, or whatever cloud) doesn’t have a thoroughly built out system anywhere near the options that are available with RDBMSs.  So there is significantly more work to do when planning for this volume of data, traffic, and scalability.

The other thing to consider is the price point.  The storage itself is about 100 times cheaper than an RDBMS in the cloud or even an RDBMS of a seriously heavy duty system.  But the question of cost comes to bare when one figures out the transactions, and other interactions among other system inside and outside of the cloud.  These costs can sometimes be prohibitive without a solid, reliable, clean, and well thought out architecture.

Anyway, those are the junctures the industry seems to be at between really big RDBMSs and moving things to NoSQL Alternatives or getting things pushed into the cloud itself.  For further information about what I’ve discussed here check out some of the following
sites:

Cloud Services I didn’t mention but are viable alternatives for hitting the limitations of your RDBMS.

In this entry I am going to cover the basics of cloud computing, which will in turn provide a kick off point for my future blog entries I have in the works.  I will explain in this entry what cloud computing is, where it exists, how it works, and most importantly the greatest benefits it provides over existing computing models.

What is Cloud Computing?

Cloud computing provides a highly redundant, vastly scalable, computationally scalable internet based shared computing.  The cloud provides the redundancy, scalability, and computing power in an on demand fashion.

Where does the Cloud Exist?

The cloud exists within the context of the Internet.  One can pinpoint certain locations for particular clouds from Amazon, Microsoft, or Google but one never really knows where the physical machines are that have the particular software, services, data, or computational power.  They can exist in any of a number of facilities throughout the world.

How does the Cloud Work?

The resources; computing power, data storage, bandwidth, or any other needs are shifted throughout the various facilities around the world as they are needed.  These are setup as content delivery networks to assure that requesting computers receive the data, computations, and bandwidth they need upon demand.

What exactly does the Cloud provide?

This question could be answered with a huge list of positives.  However, the most often stated capability that a cloud provides is the ability for a company to start an online application for a moderate monthly cost and scale that application to vast proportions at the mere click of a few options.  The fact that someone could create a Twitter, Facebook, Myspace, or something else of that sort and scale it without needing millions and millions of dollars (as those sites did).  This opens the Internet back up to the entrepreneur of modest means to create things that otherwise would be impossible.  Think of it, as the ability of the garage hacker of yesteryear to get back in the game!

Some other advantages include;

  • The ability to have a fully scalable back end system without the need for a dedicated, full-time network operations center.  This is all inclusive in the price of the cloud.
  • One thing I find keen, is that the pricing actually encourages and pushes developers to make more intelligent architectural decisions in how the design the software they put into the cloud.  There is enough software out there that is a pure catastrophe that a little encouragement to do things right is welcome in my opinion.

In subsequent blog entries I will be working off of this basic description of what the cloud is.  I will elaborate on the individual aspects and yes I will have some code coming this way very soon.  Keep your head in the clouds and enjoy the reading.

Follow

Get every new post delivered to your Inbox.

Join 3,712 other followers