Mobile Cloud Windows Azure Toolkits for Android, Windows phone and iPhone

The Windows Azure Toolkits for devices have been around for a while. However, a few days ago, there was an addition to this toolkit by giving support to Android. You can now use Windows Azure with Android. How cool is that!

So in summary, Windows Azure Toolkits for Devices now support the following.

Check out Wade Wegner’s (Technical Evangelist For Windows Azure) Channel 9 Video, on details on Windows Azure Toolkits for Devices.

Windows Azure Multi-tenancy Cloud Overview

I heard the word multi-tenancy about a year ago when it was brought up in a requirements meeting I was part of. While I can’t disclose the entire conversation, let’s just say one of the main requirements was, “This application should support multi-tenancy!”.

Since then my knowledge on multi-tenancy has grown (or so I’d like to think!) . As part of today’s blog post, I thought of writing an overview on Multi-tenancy to help anyone else, who’s hearing the word multi-tenancy for the first time!

What is Multi-tenancy?

Multi-tenancy refers to a principle in software architecture where a single instance of the software runs on a server, serving multiple client organizations (tenants)
(reference: wikipedia)

For example (a simplified one!), let’s say there are 5 customers that require to use the same application. So instead of offering 5 copies of the OS, 5 copies of the database and 5 copies of the application, there could be 1 OS, 1 Database and 1 application on the server (note: Hardware resource capabilities may defer). Thus, the 5 customers would coexist within the application and work as though they had the entire application just to themselves.

Single-Tenant vs Multi-Tenant

Single-tenant has a separate, logical instance of the application for each customer.
Multi-tenant has a single logical instance of the application which is shared by many customers.

single-tenant vs multi-tenant

(reference: Developing Applications for the Cloud on the Microsoft® Windows Azure(TM) Platform (Patterns & Practices))

Multi-Tenancy Architecture Options in Windows Azure

Multi-Tenancy in Windows Azure is not as clear cut as it is depicted in the above figure. It can get a lot more complicated! Meaning, components in Windows Azure can be designed to be single tenant or multi-tenant.

Multi-Tenancy Architecture

You think that’s hard enough, think again. Even for databases there can be many options. Do you want to share the entire database and schema with all the customers, or perhaps have one database then then have separate schemas etc. There is a good article on MSDN, titled Multi-tenant data architectures, if you like more information.

All in all, the underlying infrastructure is shared, allowing massive economy of scale with optimal repartition of load.
Additionally, multi-tenancy allows for easier application maintenance since all application code is in a single place. It is much easier (and cheaper!) to maintain, update and backup the application and its data.

I will be writing more and may be even tryout some examples with windows Azure code for multi-tenancy. Stay tuned..

Cloud Gaming: On Demand Gaming To Reduce PC Hardware Limitations

Have you ever dreamed of a day, when you could play Call of Duty: Black Ops on your iPad?

Imagine a world in which you can stream games directly onto your computer or television at 60 frames per second, with graphical settings at maximum.

It sounds exciting, doesn’t it?

If you are stuck with a low-end machine, the need for better hardware is always a stimulating thought for most gamers.

With the revolution of cloud computing, cloud gaming has gradually started to make headlines.
Cloud gaming adds a new dimension to online gaming. The game itself resides on the provider’s server and a client helps the streaming to take place. Basically, the game is directly streamed onto a computer.


You might have already heard of Software as a Service (SaaS), Platform as a Service (PaaS) etc within the context of cloud computing. One of these days, I wouldn’t be surprised to hear about GaaS- Gaming as a Service!

I recently viewed a demo of a cloud gaming service, called OnLive. They offer the ability to play games through a subscription service. You don’t have to download the software or worry about hardware requirements.
Very convenient; it’s maintenance free, negligible price to pay to the service provider (compared to the price of the hardware and games you need to buy)

If cloud gaming is embraced by many, it may pose a real threat to existing gaming consoles like Xbox (are they already in the cloud?), Playstation.
So, equip yourself with a reliable and fast internet connection and stay tune.. Cloud gaming, could definitely be a “game changer”!

A Brief History Of Cloud Computing

Once upon a time, it seems people were dreaming about computer as a utility.
• Computation and storage would be used as a public service provided by professionals
• End users would not experience the ”joy” of software installation and administration

Initial traces of cloud computing go to John McCarthy(back in the 1960s!), who proposed that computers may someday be organized in a method that would involve it acting as a public utility.

However, it we had to wait until the 1999s to actually experience this in practice!

Significant milestones

A Brief History Of Cloud Computing
1999

  • Salesforce.com pioneered the concept of delivering enterprise applications via a simple website. This made it possible for specialist and mainstream software firms to deliver applications over the internet.

2002

  • Amazon Web Services provided a suite of cloud-based services.

2006

  • Amazon launched its Elastic Compute cloud (EC2) as a commercial web service that allows small companies and individuals to rent computers on which to run their own computer applications
  • Launch of S3
    What’s interesting about S3 is that they used the pricing model of “pay-per-use”. This has now become the defacto standard for cloud computing pricing.
  • Google Apps

2009

  • Web 2.0!
  • Google App Engine

2010

  • Sun cloud
  • Microsoft Azure

….

Note: I was curious about how Cloud computing arrived. The information above is based on my online research on the subject. If you have information that might change what I’ve written above, please let me know.

Would Windows Azure Save Me Money By Running In The Cloud?

Recently, I was thinking about the promise of cloud computing. One of the hyped up promises about running in the cloud is the it save you money.

What advantages do I get using this new platform? Why might I want to host my applications with Windows Azure rather than host them myself? I’ve been thinking about this a bit lately, and thought of writing my 2 cents on it.

Let’s say I need to host a high end application, scaling across several servers. Without cloud how would I go about it?

1. I don’t need to “buy” any infrastructure to run my application!

2. The labor cost in maintaining the infrastructure servers would be significantly reduced
The cloud hosting organizations manage servers for many organizations and perform regular upgrades and backups for them all. As a result this is not something I would need to worry about, employ resource or spend money on.

3. I can scale my application out on-demand to use whatever resources it needs to meet the demands of my application.

4. I only pay for the resources that I use when I use it.
Hm… it would be nice if I had only to pay for each visitor who visited “this” site and not pay a yearly hosting fee!

The next two things are not directly related to “money” but thought of mentioning anyway

5. Windows Azure provides a platform for developers
The fact the windows azure provides a framework that allows me to develop scalable software should enhance my life as a developer!

6. Peace of mind!
This I am not sure on this one… it’s a two faced coin. Would I prefer having the servers close to my so I can keep and I? Would I want someone to call me each time a server goes down etc….
The other side of the coin, Would I totally give away control of all my servers to total strangers and trust them to take care of it?

Have you been hosting your applications on the cloud? Would like to know your experience. Does it really save money? Leave a comment and let me know.

The Windows Azure Service Life Cycle


The 5 distinct phases of the Windows Azure service life cycle

1. Design and development
The on-premise team plans, designs, and develops a cloud service for Windows Azure. The design includes quality attribute requirements for the service and the solution to fulfill them. The key roles involved in this phase are on-premise stakeholders.

2. Testing
The quality attributes of the cloud service are tested, during the testing phase. This phase involves on-premise as well as Windows Azure cloud testing. The tester role is in charge of this phase and tests end-to-end quality attributes of the service deployed into cloud testing or staging environment.

3. Provisioning
Once the application is tested, it can be provisioned to Windows Azure cloud. The deployer role deploys the cloud service to the Windows Azure cloud. The deployer is in charge of service configurations and makes sure the service definition of the cloud service is achievable through production deployment in Windows Azure cloud. The configuration settings are defined by
the developer, but the production values are set by the deployer.
In this phase, the role responsibilities transition from on-premise to the Windows Azure cloud. The fabric controller in Windows Azure assigns the allocated resources as per the service model defined in the service definition. The load balancers and virtual IP address are reserved for the service.

4. Deployment
the fabric controller commissions the allocated hardware nodes into the end state and deploys services on these nodes as defined in the service model and configuration. The fabric controller also has the capability of upgrading a service in running state without disruptions. The fabric controller abstracts the underlying hardware commissioning and deployment from the services. The hardware commissioning includes commissioning the hardware nodes, deploying operating system images on these nodes, and configuring switches, access routers, and load-balancers for the externally facing roles(e.g., Web role).

5. Maintenance
Any service on a failed node is redeployed automatically and transparently, and the fabric controller automatically restarts any failed service roles. The fabric controller allocates new hardware in the event of a hardware failure. Thus, fabric controller always maintains the desired number of roles irrespective of any service, hardware or operating system failures. The fabric controller also provides a range of dynamic management capabilities like adding capacity, reducing capacity and service upgrades without any service disruptions.

References

Getting ready for Azure development

Setting up development environment

1.  Install Microsoft Visual Studio 2008 SP1 or Microsoft Visual Studio 2010 or Microsoft Visual Web Developer 2010 Express edition. (Windows Server 2008/R2 operating system is recommended but it is also possible to run in few other windows versions)

2.  Install SQL Server 2005 express or above.

3.  Install .Net Framework 3.5 SP1 (or enable from server manager features).

4.  From Server Manager, enable Internet Information Services 7.0 with ASP.NET Application Development components.

GettingReady.EnableASPdotNetInIIS

5. Install Windows Azure Tools for Microsoft Visual Studio Download: Windows Azure Tools 1.1

 

Creating the first project

1. Run Visual Studio as an administrator.

2. Open the new project dialog box and cerate a project from template “Windows Azure Could Service”

GettingReady.NewCouldProject

3. Do some modifications to the ASP file.

4. Start “Development Fabric” from the Windows Start menu.

5. Run/Debug the program within Visual Studio and see you program working.

Windows Azure SDK: Porting Code From July CTP to Windows Azure SDK v1.0 November 2009

There have been several occasions where I downloaded some sample Windows Azure code and realized that the code was written based on the Windows Azure July CTP. The later versions of the Windows Azure SDK are not completely backward compatible with previous CTP releases. Initially, I spent a fair amount of time, trying to port such code to Windows Azure SDK v1.0 (latest is Windows Azure SDK v1.1).  Lately, I’ve ported Azure code far too many times, and thought of putting together a blog post;

If this is the first time you are trying to port from Windows Azure CTP to Windows Azure SDK v1.0, this post will save you some time.

  1. The type or namespace name ‘ServiceHosting’ does not exist in the namespace ‘Microsoft’ (are you missing an assembly reference?)

ServiceHosting.ServiceRuntime

ServiceHosting.ServiceRuntime namespace error

Also, notice the References in the solution explorer

Microsoft.ServiceHosting.ServiceRuntime

Microsoft.ServiceHosting.ServiceRuntime error

This is because the Microsoft.ServiceHosting.ServiceRuntime has been changed to Microsoft.WindowsAzure.ServiceRuntime in Windows Azure SDK v1.0 (November 2009).

To resolve this

  • Remove the reference to Microsoft.ServiceHosting.ServiceRuntime and add the reference to Microsoft.WindowsAzure.ServiceRuntime
  • Microsoft.WindowsAzure.ServiceRuntime reference

    Microsoft.WindowsAzure.ServiceRuntime reference

  • Update the code accordingly
  • Microsoft.WindowsAzure.ServiceRuntime reference code

    Microsoft.WindowsAzure.ServiceRuntime reference code

Ok, once you do all that you would think that it’s ready. Compile again; Ideally, you should see more complains ;-)

2. The name ‘RoleManager’ does not exist in the current context

RoleManager doesn't exist error

RoleManager doesn't exist error

This is because the RoleManager class has been changed to RoleEnvironment along with some of the members of the class in Windows Azure SDK v1.0 (November 2009).

To resolve this

  • Replace RoleManager with RoleEnvironment.
  • Next you have to replace IsRoleManagerRunning with IsAvailable
IsRoleManagerRunning

IsRoleManagerRunning replace with IsAvailable

Compile; we are quite not there yet.

3. The type or namespace name ‘RoleException’ could not be found (are you missing a using directive or an assembly reference?)

To resolve this

  • Replace RoleException with RoleEnvironmentException.

We are almost there ;-)

4. ‘System.Configuaration.ConfigurationSettings.AppSettings’ is obsolete

To resolve this

  • Replace GetConfigurationSetting with GetConfigurationSettingValue.

Build… Hopefully you should see “Build Succeeded”

BuildSucceeded

yay!

Note: This is not an exclusive list of “everything” that needs to be ported. I tried to address the most common ones.  For more details refer links below.

What other areas have you come across when porting July CTP to Windows Azure SDK v1.0 November 2009?

References

Managing Azure Storage: 4 Free Azure Cloud Storage Explorer Tools

1. Azure Storage Explorer

Azure Storage Explorer is a useful GUI tool for inspecting and altering the data in your Azure cloud storage projects including the logs of your cloud-hosted applications.

Azure Storage Explorer

Azure Storage Explorer

At a glance

  • All three types of cloud storage can be viewed: blobs, queues, and tables.
  • Blob items can be viewed as text, bytes, or images
  • Can create or delete blob/queue/table containers and items.
  • Text blobs can be edited and all data types can be imported/exported between the cloud and local files.
  • Table records can be imported/exported between the cloud and spreadsheet CSV files.
  • Support for multiple storage projects

Try out Azure Storage Explorer

2. CloudBerry Explorer for Azure Blob Storage

Similar to Azure Storage Explorer, CloudBerry Explorer provides a user interface to Microsoft Azure Blob Storage accounts, and files. CloudBerry lets you manage your files on cloud just as you would on your own local computer.

CloudBerry

CloudBerry

At a glance

  • Has support for Dev Storage
  • Has support for $root container
  • Copy and move files between Microsoft Azure Blob Storage and your local computer
  • Create, browse, and delete Microsoft Azure Blob Storage files, folders
  • Ability to split blobs into multiple blocks
  • Freeware version supports only 1 storage account and expires in 3 months.(update: they recently removed expiration from freeware products, refer Andy’s comment below)

Try out CloudBerry Explorer for Azure Blob Storage

3. Cloud Storage Studio

Cloud Storage Studio is a Silverlight based application using which you can manage your Azure Storage account. This is what I use :-)

Cloud Storage Studio

At a glance

  • Ability to manage multiple storage accounts simultaneously
  • Manage tables/entities, queues/messages, blob containers/blobs (create, update, delete)
  • Support for container and blob ACL policies
  • Automatically connect to Development Storage
  • Upload blobs (multiple files, folders in one shot) with the ability to pause, resume and cancel.
  • Download blobs (multiple blobs) with the ability to pause, resume and cancel.
  • 30 days to try period with full functionality, after which you can either purchase a license or let it switch to a “developer” edition, where you can continue using the access to development storage.

Try out Cloud Storage Studio

4. Gladinet Cloud Desktop

Gladinet Cloud Desktop is somewhat different to the above tools; It allows you to manage Azure Blob Storage directly from Windows Explorer. The solution makes it possible for Windows Azure Blob storage to be mapped as a virtual network Drive.

Gladinet

Gladinet

Try out Gladinet Free Starter Edition

What’s the tool that you use to manage your Azure storage?
(There can be more great ones not listed here. If you know any, please share in the comments.)

Windows Azure Blob Storage Concepts Simplified

Windows Azure Storage provides 3 fundamental data abstractions (blob, table & queue), which allow application developers to store data in the cloud. For the scope of this post, we will concentrate on blobs.

The Windows Azure Storage Data Model

Windows Azure Blob Storage Concepts

Accessing the Windows Azure Storage is done via a storage account. A storage account can have many blob containers.
A container is a user-defined set of blobs that has only properties, which include a list of the blobs it contains. Containers don’t store data directly.

Defining the blob

The word blob stands for binary large objects. Blobs store binary data, such as images, XML documents, compressed (zipped or gzipped) files, and other content as an arbitrary array of bytes within a container that’s associated with a storage account.

Blob Namespace

1. Blob URL when Storage Resources are in the Cloud (“real” storage account)

Blob URL

http://<Account>.blob.core.windows.net/<Container>/<BlobName>

Example:

  • Account – sally
  • Container – music
  • BlobName – rock/rush/xanadu.mp3
  • URL: http://sally.blob.core.windows.net/music/rock/rush/xanadu.mp3

2. Blob URL when there is a root container

A storage account can create a root container called “$root”. All the blobs that are put into this root container are accessible directly without specifying the container name. Alternatively, the root container can be explicitly referenced by its name ($root).

Blob URLs
http://<Account>.blob.core.windows.net/<BlobName> or
http://<Account>.blob.core.windows.net/$root /<BlobName>

Example:

  • Account – sally
  • Container – $root
  • BlobName – rock/rush/xanadu.mp3
  • URL: http://sally.blob.core.windows.net/rock/rush/xanadu.mp3 or
    http://sally.blob.core.windows.net/$root /rock/rush/xanadu.mp3

3. Blob URL when Storage Resources are in the development fabric

In the development fabric, the account name is part of the URI path since the local computer does not perform domain name resolution.

Blob URL

http://<local-machine-address>:<port>/<account-name>/<Container>/<BlobName>

Example:

  • Account – devstoreaccount1 (devstoreaccount1 is the storage account name in the development fabric.)
  • Container – music
  • BlobName – rock/rush/xanadu.mp3
  • URL: http://127.0.0.1:10000/devstoreaccount1/ music/rock/rush/xanadu.mp3
    (replaced AccountName.blob.core.windows.net with 127.0.0.1:10000/devstoreaccount1 for Development Storage.)

Types of Blobs

1. Block Blob
A Block blobs is a collection of blocks, where each block has a block ID (of 64 bytes). A Block Blob can be up to 200GB. You can upload a maximum of 64MB of data in a Put Blob operation to create a blob. If it is larger than 64MB it must be sent in multiple chunks of no more than 4MB, with Put Block operations.

2. Page Blob
A Page Blob can be up to 1TB is size and is organized into 512 byte pages within the block. Any point in the blob can be accessed for read or write operations by using the offsite from the start of the blob.

note: I will discuss in-depth details on block/page blobs and how blob concurrency is managed in a future post. Stay tuned!

References