How can a company's applications be scalable and have high availability? To achieve this, along with developing the applications, you must also have an infrastructure that can support them. For example, you may need to add servers or increase the capacities of existing ones, have redundant hardware, add logic to the application to handle distributed computing, and add mechanisms to handle failover. You have to do this even if an application is in high demand for only short periods of time. Life becomes even more complicated (and expensive) when you start to consider issues such as network latency and security boundaries.
The cloud offers a solution to this dilemma. The cloud is made up of interconnected servers located in various data centers. However, you see what appears to be a centralized location that someone else hosts and manages. By shifting the responsibility of maintaining an infrastructure to someone else, you're free to concentrate on what matters most: the application. If the cloud has data centers in different geographical areas, you can move your content closer to the people who are using it most. If an application is heavily used in Asia, have an instance running in a data center located there. This kind of flexibility may not be available to you if you have to own all the hardware. Another advantage to the cloud is that it's a “pay as you go” proposition. If you don't need it, you don't have to pay for it. When demand is high, you can scale up, and when demand is low, you can scale back.
Yes, by moving applications to the cloud, you're giving up some control and autonomy, but you're also going to benefit from reduced costs, increased flexibility, and scalable computation and storage. This guide shows you how to do this.
Who This Book Is For
This book is the first volume in a series about Windows Azure. It demonstrates how you can adapt an existing, on-premises ASP.NET application to one that operates in the cloud. The book is intended for any architect, developer, or information technology (IT) professional who designs, builds, or operates applications and services that are appropriate for the cloud. Although applications do not need to be based on the Microsoft Windows operating system to work in Windows Azure or written using a .NET language, this book is written for people who work with Windows-based systems. You should be familiar with the Microsoft .NET Framework, Microsoft Visual Studio, ASP.NET, and Microsoft Visual C#.
Why This Book Is Pertinent Now
In general, the cloud has become a viable option for making your applications accessible to a broad set of customers. In particular, Windows Azure now has in place a complete set of tools for developers and IT professionals. Developers can use the tools they already know, such as Visual Studio, to write their applications. In addition, the Windows Azure SDK includes the compute emulator and the storage emulator. Developers can use these to write, test, and debug their applications locally before they deploy them to the cloud. There are also tools and an API to manage your Windows Azure accounts. This book shows you how to use all these tools in the context of a common scenario—how to adapt an existing ASP.NET application and deploy it to Windows Azure.
How This Book Is Structured
Chapter 1, “The Adatum Scenario” introduces you to the Adatum company and the aExpense application. The following chapters describe how Adatum migrates the aExpense application to the cloud. Reading this chapter will help you understand why Adatum wants to migrate some of its business applications to the cloud, and it describes some of its concerns. It will also help you to understand basic options for hosting applications and services in the cloud.
Chapter 2, “Getting to the Cloud” describes the first steps that Adatum took in migrating the aExpense application. Adatum's goal here is simply to get the application working in the cloud, but this includes “big” issues such as security and storage. The chapter shows how Adatum used Windows Azure virtual machines and network services to deploy and communicate with the hosted servers.
Chapter 3, “Moving to Windows Azure Cloud Services” describes how Adatum adapted the aExpense application to run as a hosted service in Windows Azure by using the Cloud Services feature. The chapter describes how Adatum modified the solution, converted it to use claims authentication instead of Active Directory, and took advantage of Windows Azure Caching for the session data.
Chapter 4, “Moving to Windows Azure SQL Database” describes how Adatum evaluated the use of Windows Azure SQL Database instead of a hosted SQL Server by exploring the limitations this might impose and the cost savings that it might provide. The chapter then goes in to show how Adatum converted the aExpense application to use Windows Azure SQL Database.
Chapter 5, “Executing Background Tasks” describes adding a worker role to the aExpense application to process scanned receipt images as a background task. It also shows how aExpense uses Windows Azure blob storage for storing these images, and shared access signatures to provide secure access to them.
Chapter 6, “Evaluating Cloud Hosting Costs” introduces a basic cost model for the aExpense application running on Windows Azure and shows how Adatum calculated the estimated annual running costs for the application.
Chapter 7, “Moving to Windows Azure Table Storage” describes how Adatum switched from using a SQL database to using Windows Azure table storage in the aExpense application. It discusses the differences between the two storage models, and shows how Adatum adapted the data access code to work with Windows Azure table storage. This chapter also discusses how Adatum fine-tuned the application after deployment, and the options it is considering for improving the application in the future.
What You Need to Use the Code
These are the system requirements for running the scenarios:
- Microsoft Windows 7 with Service Pack 1, Microsoft Windows 8, Microsoft Windows Server 2008 R2 with Service Pack 1, or Microsoft Windows Server 2012 (32 bit or 64 bit editions).
- Microsoft .NET Framework version 4.0.
- Microsoft Visual Studio 2010 Ultimate, Premium, or Professional edition with Service Pack 1 installed, or Visual Studio 2012 Ultimate, Premium, or Professional edition.
- Windows Azure SDK for .NET (includes the Windows Azure Tools for Visual Studio). See the Release Notes for information on the specific version required.
- Microsoft SQL Server 2012, SQL Server Express 2012, SQL Server 2008, or SQL Server Express 2008. See the Release Notes for information on specific versions depending on your operating system.
- Windows Identity Foundation. This is required for claims-based authorization.
- WatiN 2.0. Open the Properties dialog and unblock the zip file after you download it and before you extract the contents. Place the contents in the Lib\Watin folder of the examples.
Other components and frameworks required by the examples are installed using NuGet when you run the solutions. See the Release Notes included with the examples for instructions on installing and configuring them.
As mentioned earlier, this book uses a set of scenarios that demonstrates how to move applications to the cloud. A panel of experts comments on the development efforts. The panel includes a cloud specialist, a software architect, a software developer, and an IT professional. The scenarios can be considered from each of these points of view. The following table lists the experts for these scenarios.
Bharath is a cloud specialist. He checks that a cloud-based solution will work for a company and provide tangible benefits. He is a cautious person, for good reasons.
"Moving a single application to the cloud is easy. Realizing the benefits that a cloud-based solution can offer is not always so straight-forward".
Jana is a software architect. She plans the overall structure of an application. Her perspective is both practical and strategic. In other words, she considers not only what technical approaches are needed today, but also what direction a company needs to consider for the future.
"It's not easy to balance the needs of the company, the users, the IT organization, the developers, and the technical platforms we rely on.
Markus is a senior software developer. He is analytical, detail-oriented, and methodical. He's focused on the task at hand, which is building a great cloud-based application. He knows that he's the person who's ultimately responsible for the code.
"I don't care what platform you want to use for the application, I'll make it work."
Poe is an IT professional who's an expert in deploying and running in a corporate data center. Poe has a keen interest in practical solutions; after all, he's the one who gets paged at 3:00 AM when there's a problem.
"Migrating to the cloud involves a big change in the way we manage our applications. I want to make sure our cloud apps are as reliable and secure as our on-premise apps."
If you have a particular area of interest, look for notes provided by the specialists whose interests align with yours.