Discuss the future of Microsoft Azure Cloud, AWS Cloud, or Google Cloud Services . Address atleast two (2) new cloud technologies in the works, not fully in use as of today. The technology can be SaaS, PaaS, or IaaS. Support your discussion with Citation/Reference, includ URL if available.
2/18/2020
Chapter 19 Application Scalability – Cloud Computing
⏮
Cloud Computing
NEXT
PREV
Chapter 18 Coding Cloud-Based Applications
🔎
Chapter 20 The Future of the Cloud
⏭
chapter 19
Application Scalability
SCALABILITY REFERS TO AN application’s ability to add or remove
resources dynamically based on user demand. Throughout this book, you
have learned that one of the greatest advantages of cloud-based applications is their ability to scale. Anticipating user demand is often a
“best guess” process. In the past, developers had to release site resources
(servers, CPUs, disk space) capable of meeting the anticipated initial user
demand, plus growth. Often developers could not accurately project the
demand, and frequently they released too few or too many resources.
Learning Objectives
This chapter examines the resource-scaling process. By the time you finish this chapter, you will be able to do the following:
• Define and describe scalability.
• Define and describe the Pareto principle.
• Compare and contrast scaling up and scaling out.
• Understand how the law of diminishing returns applies to the scalability process.
• Describe the importance of understanding a site’s database read/write
ratio.
• Compare and contrast scalability and capacity planning.
• Understand how complexity can reduce scalability.
CASE 19-1 THE PARETO PRINCIPLE (80/20 RULE)
Whether you are developing code, monitoring system utilization, or debugging an application, you need to consider the Pareto principle, also
known as the 80/20 rule, or the rule of the vital few and the trivial many.
The Pareto principle accurately describes different scenarios such as the
following:
• 80 percent of development time is spent on 20 percent of the code.
• 80 percent of errors reside in 20 percent of the code.
• 80 percent of CPU processing time is spent within 20 percent of the
code.
• 80 percent of system use comes from 20 percent of the users.
If you consider the Pareto principle, you may find that you do not need to
optimize all of an application’s code. Instead, you can focus your effort on
20 percent of the code that users use most often.
Exercise Consider system performance monitoring. What other relationships, such as disk space use or database space use, may relate to the
Pareto principle?
Web Resources For more information on the Pareto principle, visit
www.CloudBookContent.com/Chapter19/index.html (http://www.CloudBookContent.com/Chapter19/index.html).
Reviewing the Load-Balancing Process
Cloud-based solutions should scale on demand. This means that if an application’s user demand reaches a specific threshold, one or more servers
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter19.xhtml
1/7
2/18/2020
Chapter 19 Application Scalability – Cloud Computing
should be added dynamically to support the application. Likewise, when
the demand decreases, the application should scale down its resource use.
When an application uses multiple servers, one server, as shown in
FIGURE 19-1, must perform the task of load balancing.
The load-balancing server receives client requests and distributes each request to one of the available servers. To determine which server gets the
request, the load balancer may use a round-robin technique, a random algorithm, or a more complex technique based upon each server’s capacity
and current workload. For an application to exploit load balancing fully,
the application developers must design the application for scaling.
FIGURE 19-1 The load-balancing server distributes workload across
an application’s server resources.
CASE 19-2 GANGLIA MONITORING SYSTEM
If you are using Linux-based servers, you should consider deploying the
Ganglia Monitoring System to monitor your system use. Ganglia is an
open-source project created at the University of California, Berkeley. The
software monitors and graphically displays the system utilization, as
shown in FIGURE 19-2.
FIGURE 19-2 Monitoring system utilization using the Ganglia Monitoring System.
Exercise Examine the Ganglia Monitoring System. Which of the system’s
features are most critical to cloud administrators? Why?
Web Resources For more information on the Ganglia Monitoring System, visit www.CloudBookContent.com/Chapter19/index.html (http://www.CloudBookContent.com/Chapter19/index.html).
Designing for Scalability
Often developers take one of two extremes with respect to designing for
scalability—they do not support scaling or they try to support unlimited
scaling. In general, developers should focus their effort somewhere in the
middle. In other words, they should design and build the application with
the expectation that it will scale to a point, possibly beyond reasonable expectations. It is important to note that most applications do not experience, and therefore do not need to support, overnight success.
Scaling Up, Scaling Out, or Both
Before you discuss or plan for scaling, it is important to understand that
there are two ways to scale a solution. First, you can scale up an application (known as vertical scaling) by moving the application to faster
computer resources, such as a faster server or disk drive. If you have a
CPU-intensive application, moving the application to a faster CPU should
improve performance. Second, you can scale out an application (known as
horizontal scaling) by rewriting the application to support multiple
CPUs (servers) and possibly multiple databases. As a rule, normally it
costs less to run an application on multiple servers than on a single server
that is four times as fast.
Assume, for example, that your application makes extensive use of a web
service to perform complex processing. If the web service becomes a bottleneck, a place where system traffic slows because of lack of resources,
you could host the web service on a faster server (by scaling up) or you
could place the web service on multiple servers, which the application
may call in a round-robin fashion (by scaling out). As shown in FIG-
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter19.xhtml
2/7
2/18/2020
Chapter 19 Application Scalability – Cloud Computing
URE 19-3, over time, a developer may use both vertical and horizontal
scaling.
FIGURE 19-3 Developers often use vertical and horizontal scaling
to meet application demands.
CASE 19-3 WEBPAGETEST
Before you consider scaling, you should understand your system performance and potential system bottlenecks. www.webpagetest.org
(http://www.webpagetest.org)
evaluates your site and creates a detailed report,
as shown in FIGURE 19-4. The report helps you identify images you
can further compress and the impact of your system caches, as well as potential benefits of compressing text.
Exercise Use WebPagetest to evaluate two or more websites. Discuss
how the report’s findings align with your user experience.
Web Resources For more information on WebPagetest, visit www.CloudBookContent.com/Chapter19/index.html (http://www.CloudBookContent.com/Chapter19/index.html).
FIGURE 19-4 Using WebPagetest to evaluate system performance.
Minimize Objects on Key Pages
Across the Web, developers strive for site pages that load in 2 to 3 seconds
or less. If a web page takes too long to load, visitors will simply leave the
site. With that in mind, you should evaluate your key site pages, particularly the home page. If possible, reduce the number of objects on the page
(graphics, audio, and so on), so that the page loads within an acceptable
time.
Selecting Measurement Points
As you analyze your site with respect to scalability, you will want your efforts to have a maximum performance impact. To begin, identify the potential bottlenecks within the system, both with respect to CPU utilization
and database use. If, for example, you scale part of the system that is not
in high demand, your scaling will not significantly affect system performance. As you consider your measurement points, keep the 80/20 rule in
mind and strive to identify the 20 percent of your code that performs 80
percent of the processing.
CASE 19-4 ALERTRA WEBSITE MONITORING
Often, system administrators do not know that a site has gone down until
a user contacts them. Alertra, shown in FIGURE 19-5, provides a
website monitoring service. When it detects a problem, it sends an e-mail
or text message to the site’s administrative team. Companies can schedule
Alertra to perform its system checks minute-by-minute or hourly.
Exercise Discuss the benefits of having a real-time site monitor and describe how you would justify the investment of using such a site.
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter19.xhtml
3/7
2/18/2020
Chapter 19 Application Scalability – Cloud Computing
Web Resources For more information on the Alertra Website Monitoring service, visit www.CloudBookContent.com/Chapter19/index.html
(http://www.CloudBookContent.com/Chapter19/index.html).
FIGURE 19-5 Alertra notifies system administrators about a cloudbased system error or failure.
Analyze Your Database Operations
As you know, load balancing an application that relies on database operations can be challenging, due to the application’s need to synchronize
database insert and update operations. Within most sites, most of the
database operations are read operations, which access data, as opposed to
write operations, which add or update data. Write operations are more
complex and require database synchronization.
You may be able to modify your application so that it can distribute the
database read operations, especially for data that are not affected by write
operations (static data). By distributing your database read operations in
this way, you horizontally scale out your application, which may not only
improve performance, but also improve resource redundancy.
CASE 19-5 PINGDOM WEBSITE MONITORING
Pingdom provides real-time site monitoring with alert notification and
performance monitoring. It notifies you in the event of system downtime
and provides performance reports based on your site’s responsiveness. As
shown in FIGURE 19-6, Pingdom provides tools you can use to
identify potential bottlenecks on your site.
Exercise Discuss the potential bottlenecks that are common to all cloudbased sites.
Web Resources For more information on Pingdom Website Monitoring, visit www.CloudBookContent.com/Chapter19/index.html (http://www.CloudBookContent.com/Chapter19/index.html).
FIGURE 19-6 Pingdom performance reports identify system
bottlenecks.
Evaluate Your System’s Data Logging Requirements
When developers deploy new sites, often they enable various logging capabilities so they can watch for system errors and monitor system traffic.
Frequently, they do not turn off the logs. As a result, the log files consume
considerable disk space, and the system utilizes CPU processing time updating the files. As you monitor your system performance, log only those
events you truly must measure.
CASE 19-6 GOMEZ WEB PERFOMANCE BENCHMARKS
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter19.xhtml
4/7
2/18/2020
Chapter 19 Application Scalability – Cloud Computing
Many times developers want to compare their site’s benchmarks with
those of other sites. This is where Gomez comes into play. Gomez provides
site benchmarking for web and mobile applications. It provides crossbrowser testing as well as load testing. In addition, as shown in FIG-
URE 19-7, Gomez performs real-user monitoring, which focuses on
the user experience with respect to the browser influence, geographic location, communication speed, and more.
Exercise Discuss the importance of performing real-user monitoring.
Web Resources For more information on Gomez Web Performance
Benchmarks, www.CloudBookContent.com/Chapter19/index.html
(http://www.CloudBookContent.com/Chapter19/index.html).
FIGURE 19-7 Using Gomez Web Performance Benchmarks to measure the user experience.
Revisit Your Service-Level Agreement
As you plan for your site’s scalability, take time to review your service-level agreement (SLA) with the cloud-solution provider. The SLA may specify
performance measures that the provider must maintain, which, in turn,
provides the resources to which your application can scale. As you review
your SLA, make sure you understand the numbers or percentages it
presents. For example, many solution providers claim 99.9 percent uptime and availability. If you do the math, you will see that if your site is
down 0.1 percent of the time, it equals
(0.1%)(365 days/year)(24 hours/day)(60 minutes/hour) = 525 minutes
per year (nearly 10 hours)
Capacity Planning Versus Scalability
Scalability defines a system’s ability to use additional resources to meet
user demand. In contrast, capacity planning defines the resources your
application will need at a specific time. The two terms are related, yet different. When you first design a system, for example, you might plan for
10,000 users accessing the system between 6:00 a.m. and 6:00 p.m.
Starting with your user count, you can then determine the number of
servers needed, the bandwidth requirements, the necessary disk space,
and so on. In other words, you can determine the capacity your system
needs to operate.
When your user demand exceeds your system capacity, you must scale the
system by adding resources.
Scalability and Diminishing Returns
If an application is designed to scale (vertical, or scaling up to faster resources is easy), the question becomes “How many resources are
enough?” Keep in mind that you will start a scaling process to meet performance requirements based upon user demand. To measure performance, you should select benchmarks that are most meaningful, such as
the following:
• Support for 5,000 simultaneous users
• CPU utilization that does not exceed 50 percent
• Loading of the home page in 3 seconds or less
• Loading of all pages in 5 seconds or less
• Completions of all user submitted operations in 10 seconds or less
With your selected benchmarks in place, you can begin to measure the
performance effects of scaling. At first, adding a faster processor, more
servers, or increased bandwidth should have measurable system performance improvements. However, you will reach a point of diminishing
returns, as shown in FIGURE 19-8, when adding additional re-
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter19.xhtml
5/7
2/18/2020
Chapter 19 Application Scalability – Cloud Computing
sources does not improve performance. At that point, you should stop
scaling.
FIGURE 19-8 You will reach a point of diminishing returns, at
which point further scaling does not significantly improve application
performance.
Performance Tuning
Your goal is to maximize system performance. By scaling resources, you
will, to a point, increase performance. In addition to managing an application’s resource utilization, developers must examine the application itself,
beginning with the program code and including the objects used, such as
graphics and the application’s use of caching. Caching is the use of a
faster disk drive or faster random access memory to store items that are
used repeatedly by the application in order to improve system
performance
This process is known as performance tuning. To start the process,
look for existing or potential system bottlenecks. After you correct those,
you should focus on the 20 percent of the code that performs 80 percent
of the processing—which will provide you the biggest return on your system tuning investment.
Complication Is the Enemy of Scalability
As you design solutions, remember that as complexity within a system increases, so too does the difficulty of maintaining the underlying code, as
well as the overhead associated with the complex code. Furthermore, as
an application’s complexity increases, its ability to scale usually decreases.
When a solution begins to get complex, it is worth stopping to evaluate
the solution and the current design. Often, complexity occurs because a
solution is trying to handle all possible conditions—some of which may
never occur. If you design the solution for the common conditions (the
80/20 rule) in a simple way, your code will be easier to modify in the future, perhaps to support horizontal scaling.
CASE 19-7 KEYNOTE CLOUD MONITORING
Keynote, as shown in FIGURE 19-9, is one of the world’s largest
third-party monitors of cloud and mobile applications. In fact, the company performs more than 100 billion site measurements each year. Keynote
uses thousands of measurements that come from computers dispersed
across the globe. In addition to providing notification of site downtime,
Keynote provides a real-time performance dashboard.
Exercise Discuss the importance of testing a cloud solution’s performance from computers dispersed across the globe.
Web Resources For more information on Keynote Cloud Monitoring,
visit www.CloudBookContent.com/Chapter19/index.html (http://www.CloudBookContent.com/Chapter19/index.html).
FIGURE 19-9 Keynote Cloud Monitoring provides site performance
in real time.
CHAPTER SUMMARY
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter19.xhtml
6/7
2/18/2020
Chapter 19 Application Scalability – Cloud Computing
An application’s scalability corresponds to its ability to add or remove resources dynamically based on user demand. One of the greatest advantages of cloud-based applications is their ability to scale. Unfortunately,
often it is difficult for developers to identify what an application’s user demand will be. Often, developers will release site resources (servers, CPUs,
disk space) capable of meeting the anticipated initial user demand, plus
growth. When developers are wrong, however, the project will have too
few or too many resources. This chapter examined ways applications can
scale up to faster processors or scale out to utilize more resources.
KEY TERMS
Bottleneck
Caching
Point of diminishing returns
Horizontal scaling
Pareto principle
Performance tuning
Vertical scaling
CHAPTER REVIEW
1. Define scalability.
2. List five to ten potential relationships that align with the Pareto principle, such as how 80 percent of sales come from 20 percent of customers.
3. Compare and contrast vertical and horizontal scaling.
4. Explain the importance of the database read/write ratio.
5. Assume a site guarantees 99.99 percent uptime. How many minutes
per year can the site be down?
Settings / Support / Sign Out
© 2020 O’Reilly Media, Inc. Terms of Service / Privacy Policy
⏮
PREV
Chapter 18 Coding Cloud-Based Applications
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter19.xhtml
NEXT
Chapter 20 The Future of the Cloud
⏭
7/7
2/18/2020
Chapter 18 Coding Cloud-Based Applications – Cloud Computing
⏮
Cloud Computing
NEXT
PREV
Chapter 17 Designing Cloud-Based Solutions
🔎
Chapter 19 Application Scalability
⏭
chapter 18
Coding Cloud-Based Applications
BEHIND THE SCENES, DEVELOPERS who create new cloud-based
applications or who move existing applications to the cloud are truly driving the cloud’s explosive growth. Creating a cloud-based application is
very similar to building a traditional web-based application. Developers
normally use a programing language such as PHP, Ruby, Perl, Pty, or C#,
along with HTML and CSS, and a database. As discussed in Chapter 3,
Platform as a Service (PaaS), many cloud-solution providers offer tools
that developers need to build and deploy a solution. In this chapter, we
will look at two of the most widely used developer platforms: Google App
Engine and Windows Azure. In addition, many companies now offer tools
that nonprogrammers can use to create and display a solution without
coding. We’ll look at one such tool, Yahoo! Pipes, and its ability to help
users create a mashup.
Learning Objectives
This chapter examines coding cloud-based applications. By the time you
finish this chapter, you will be able to do the following:
• Use Yahoo! Pipes to create a mashup.
• Create and deploy a cloud-based application using Google App Engine.
• Create and deploy a cloud-based application using Windows Azure.
Creating a Mashup Using Yahoo! Pipes
Across the cloud, different sites provide different content offerings. A
mashup is a page that combines several such independent pieces of content. As shown in FIGURE 18-1, a mashup may be created and delivered by a server, or a browser may use JavaScript to combine the content.
FIGURE 18-1 A mashup combines content from several sources
onto the same page.
Yahoo! Pipes is a cloud-based application that provides a graphical user
interface (GUI) that programmers can use to combine content (create a
mashup) by dragging and dropping content sources onto a canvas. Later,
when a user views a pipe, the user will see the corresponding content.
FIGURE 18-2, for example, illustrates the user view of a pipe that
combines news feeds from a wide range of sources.
Pipes are so named because they let developers connect the data flowing
from one source into the data processed by another. FIGURE 18-3,
for example, illustrates the pipes to create the news feed previously
shown.
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter18.xhtml
1/9
2/18/2020
Chapter 18 Coding Cloud-Based Applications – Cloud Computing
FIGURE 18-2 Yahoo! Pipes allows developers to combine content
from multiple sources into a single mashup.
FIGURE 18-3 Yahoo! Pipes flow the content from one source into
the input of a second source.
Similarly, FIGURE 18-4 illustrates a pipe that combines movie reviews with photos from Flickr and videos from YouTube.
FIGURE 18-4 Using Yahoo! Pipes to mash content from several
sites to create a movie review.
FIGURE 18-5 Using Yahoo! Pipes to combine text, image, and video
data into a user interface.
Again, the developer created this pipe by connecting data sources, as
shown in FIGURE 18-5.
Creating a Simple Yahoo! Pipe
To create your own Yahoo! Pipe, visit pipes.yahoo.com
(http://pipes.yahoo.com),
as shown in FIGURE 18-6.
FIGURE 18-6 To create a pipe, start at pipes.yahoo.com
(http://pipes.yahoo.com).
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter18.xhtml
2/9
2/18/2020
Chapter 18 Coding Cloud-Based Applications – Cloud Computing
FIGURE 18-7 To create a Yahoo! Pipe, users drag and connect data
sources within the Yahoo! Pipe canvas.
Within the page, log in to Yahoo! and click the Create Pipe button. Your
browser, in turn, will display the pipe canvas and the data sources that
you can use to create your pipe, as shown in FIGURE 18-7.
In this example, you will create a pipe called FindIt, which prompts the
user to enter an item (store, restaurant, or other destination) and a geographic area (city, state, or zip code) as shown in FIGURE 18-8.
FIGURE 18-8 The user interface of a Yahoo! Pipe, which prompts
the user for an item and location.
FIGURE 18-9 Using a Yahoo! Pipe to display locations that offer
pizza.
After the user types in the item and location, the page will display the location of items that match. For example, FIGURE 18-9 lists locations within Prescott, Arizona, that offer pizza.
To create your Yahoo! Pipe, perform the following steps:
1. From the left side of the screen, drag a Text Input object from the User
Input group onto the canvas.
2. Label the Name of the Text Input object as Item and set the prompt to
Item.
3. From the Sources group, drag a Yahoo! local object onto the canvas.
Within the object, change the “Within” field to “20 miles.”
4. Using your mouse, drag the circle found at the bottom of the Text Input
box into the Find field of the Yahoo! Local box. The canvas will display a
pipe, as shown in FIGURE 18-10.
5. From the Location group, drag and drop a Location Build object onto
the canvas.
6. From the User Input group, drag another Text Input object onto the
canvas. Label the object’s Name as Location and set the prompt to
Location.
7. Using your mouse, drag the circle from the new text box into the Location field of the Location Builder object. The canvas will display a second
pipe, as shown in FIGURE 18-11.
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter18.xhtml
3/9
2/18/2020
Chapter 18 Coding Cloud-Based Applications – Cloud Computing
Figure 18-10 Using a pipe to connect objects within a Yahoo! Pipe.
FIGURE 18-11 Creating a second pipe to connect objects.
8. Using your mouse, drag the circle from the Yahoo! Location box to the
Pipe Output object. The canvas will display the third and final pipe, as
shown in FIGURE 18-12.
FIGURE 18-12 Using a pipe to specify the user output.
9. Click the Save button and specify a name under which to save your
pipe.
10. Click the Properties button. Your browser will display a link that you
can use to run your pipe (display the pipe’s output).
Later, if you share the URL to your pipe with other users, they can use it
to search for a wide range of items. FIGURE 18-13, for example,
shows the pipe’s input screen and output results for pipe search.
Using Google App Engine
Using Google App Engine, developers can deploy applications that run
on the Google infrastructure. Google maintains the servers, scales the applications, and performs the behind-the-scenes server administration. Developers can get started with Google App Engine at no charge. As an application’s demand increases, Google allows developers to pay only for the
resources they consume. Developers normally build Google App Engine
solutions using Java, Python, or PHP.
FIGURE 18-13 Displaying the results of a Yahoo! Pipe.
Creating a Hello, World! Application with Google App Engine
To start, create the following simple Python application, which displays
the text “Hello, world!” to the user:
print “Content-type: text/html\n\n”
print “Hello, world!”
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter18.xhtml
4/9
2/18/2020
Chapter 18 Coding Cloud-Based Applications – Cloud Computing
After you have the application working locally, you can upload the application to the Google App Engine. Visit appengine.google.com (http://appengine.google.com)
and log in to a Google account. Then select the Create Ap-
plication button. You may need to authenticate yourself to Google further
before you can continue.
Downloading the Google App Engine Software Development Kit
Depending on the programming language you are using to develop your
application, you will need to download and install the corresponding
Google App Engine software development kit (SDK). For this example, you would download the Python SDK. The SDK, in turn, provides utility programs you can use to upload your program into the Google App
Engine.
Deploying a Simple Google App Engine Example
To begin, open a command line window as shown in FIGURE 18-14
and locate the file folder that contains the appcfg.py script, which was created by the SDK installation.
FIGURE 18-14 Using a command line window, locate the appcfg.py
script that you will use to upload your Python script to the Google
App Engine.
For this example, create a folder within the folder that contains appcfg.py
named Hello, within which you store the Hello.py script:
print “Content-type: text/html\n\n”
print “Hello, world!”
Next, within the same folder, create a file named app.yaml, which Google
will use to configure your application. Use the following script, replacing
the value 2a2a2a2a2a2abbb with the application ID you received from
Google:
Then, run the appcfg.py script, as shown in FIGURE 18-15, to upload your application.
You can then test your application from Google’s appspot website, as
shown in FIGURE 18-16.
FIGURE 18-15 For a Python script, the appcfg.py script will upload
the application into the Google App Engine.
FIGURE 18-16 Running a Python script deployed to the Google App
Engine.
Creating a More Advanced Google App Engine Application
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter18.xhtml
5/9
2/18/2020
Chapter 18 Coding Cloud-Based Applications – Cloud Computing
To assist developers in creating applications, Google provides a variety of
application program interfaces (APIs). The following code uses a Google
API to display specifics about the current user:
If you place this code into your previous Hello.py script, you can then rerun the previous appcfg.py script to upload the application into the
Google App Engine.
When you later run the script, Google will prompt you to log in. Then the
page will display your user specifics, as shown in FIGURE 18-17.
Creating a Windows Azure “Hello, World!” Application
For .Net developers, creating a Windows Azure application is a natural extension of their previous ASP.NET (http://ASP.NET) development. The developers will use the Visual Studio to create and deploy their applications.
Eventually, support for Windows Azure will be integrated into Visual Studio. At the time of this writing, however, developers must download and
install a Windows Azure software development kit as well as tools for Visual Studio. In addition, developers must register at the Windows Azure
site—which they can do free of charge. At the Windows Azure site, developers will find tutorials to guide them through the process of creating and
deploying a cloud-based application.
FIGURE 18-17 Displaying a user’s Google specifics.
FIGURE 18-18 Creating a cloud-based project hosted on Windows
Azure.
After you install the Windows Azure SDK and Visual Studio support tools,
start Visual Studio and create a new project. Within Visual Studio’s list of
installed templates, select Cloud, as shown in FIGURE 18-18.
Within the New Windows Azure Project dialog box, select the ASP.NET
(http://ASP.NET)
Web Role entry, as shown in FIGURE 18-19.
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter18.xhtml
6/9
2/18/2020
Chapter 18 Coding Cloud-Based Applications – Cloud Computing
FIGURE 18-19 Using the ASP.NET (http://ASP.NET) Web Role to create your cloud application.
FIGURE 18-20 Modify the Default.aspx file’s contents and screen
display.
Next, within Visual Studio, edit the Default.aspx file to change the text
from Welcome to ASP.NET (http://ASP.NET)! to Welcome to the Cloud, as
shown in FIGURE 18-20.
Select the Project menu Package option. Visual Studio will display the
Package Windows Azure Application dialog box. Select OK. Your screen
will display a window that contains the package files, as shown in FIG-
URE 18-21. Note the name of the folder within which the package files
reside. You will need the files later to upload your application to Windows
Azure.
Log in to the Windows Azure site, as shown in FIGURE 18-22.
FIGURE 18-21 Displaying package files within Visual Studio.
FIGURE 18-22 To upload a program, you must first log in to the
Windows Azure site.
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter18.xhtml
7/9
2/18/2020
Chapter 18 Coding Cloud-Based Applications – Cloud Computing
FIGURE 18-23 Providing Windows Azure with specifics about your
application.
Click the New Hosted Services button. Your screen will display a dialog
box similar to that shown in FIGURE 18-23, which you must
complete.
Using the folders within which you stored the application’s package files,
complete the dialog box fields. Windows Azure, in turn, will begin the upload process, eventually displaying specifics about the application, as
shown in FIGURE 18-24.
Using the URL provided in the Windows Azure project specifics, deploy
your application. Your browser, in turn, should display the cloud-hello
message, as shown in FIGURE 18-25.
FIGURE 18-24 Loading an application into the Windows Azure
platform.
FIGURE 18-25 Successfully deploying an application within Windows Azure.
CHAPTER SUMMARY
Cloud use is driven by new applications, which means that developers
who create new cloud-based applications or who move existing applications to the cloud are the ones truly driving the cloud’s explosive
growth. In general, creating a cloud-based application is similar to building a traditional web-based application. That is, developers will use a programing language such as PHP, Ruby, Perl, Pty, or C#, along with HTML
and CSS, and a database. In addition, many cloud-solution providers offer
tools that developers need to build and deploy a solution without having
to code. Such applications should accelerate the rate at which applications
enter the cloud. In this chapter, you learned how to use Google App Engine and Windows Azure to deploy a cloud-based application. In addition,
you learned how Yahoo! Pipes allows users to create mashups without the
need for code.
KEY TERMS
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter18.xhtml
8/9
2/18/2020
Chapter 18 Coding Cloud-Based Applications – Cloud Computing
Google App Engine
Software development kit (SDK)
Yahoo! Pipes
CHAPTER REVIEW
1. Using Yahoo! Pipes, create a pipe that displays the names of pizza
restaurants within a given zip code.
2. Using Google App Engine, create a page that displays the following
Python script:
print “Content-type: text/html\n\n”
print “Cloud Computing, Chapter 18”
Settings / Support / Sign Out
© 2020 O’Reilly Media, Inc. Terms of Service / Privacy Policy
⏮
PREV
Chapter 17 Designing Cloud-Based Solutions
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter18.xhtml
NEXT
Chapter 19 Application Scalability
⏭
9/9
2/18/2020
Chapter 17 Designing Cloud-Based Solutions – Cloud Computing
⏮
Cloud Computing
NEXT
PREV
Chapter 16 Evaluating the Cloud’s Business Impact and Econo…
🔎
Chapter 18 Coding Cloud-Based Applications
⏭
chapter 17
Designing Cloud-Based Solutions
THROUGHOUT THIS BOOK, WE have looked at a variety of cloudrelated issues, from scalability to security to economics and business
models. In Chapter 18, Coding Cloud-Based Applications, we will build
and deploy several simple cloud-based solutions. In this chapter, we look
at many design considerations a developer should consider when designing a cloud-based solution.
Learning Objectives
This chapter examines cloud-based solution designs. By the time you finish this chapter, you will be able to do the following:
• Compare and contrast functional and nonfunctional system
requirements.
• Understand why developers should delay selecting an implementation
platform during the design phase.
• Discuss considerations designers should evaluate when they design a
system to meet specific nonfunctional requirements.
Revisit the System Requirements
Before you begin the design process, you must ensure that you have a
complete set of system requirements. If the system requirements were defined by another individual or group, you should review the requirements
and then walk through your understanding of them with the group and
ideally the stakeholder who served as the expert for the requirements
specification. Identifying errors, omissions, and misunderstandings early
in the design process will save considerable time and money later.
System requirements fall into one of two categories: functional requirements and nonfunctional requirements. The functional requirements specify what the system does—that is, the specific tasks the system
will perform. Normally, the functional requirements are provided by the
system or business analyst to the designer within the specification of the
things that the system needs to do. In contrast, nonfunctional requirements specify how the system will work behind the scenes. Nonfunctional requirements are often called quality requirements and include
common factors such as performance, reliability, and maintainability. As
a designer with a strong working knowledge of the cloud environment,
you can exhibit considerable influence on the system’s design to meet the
nonfunctional requirements. Much of this chapter examines specific design considerations for nonfunctional requirements.
When to Select a Development Environment
Many developers want to be quick to select the platform upon which they
will develop and implement the solution. That is, they want to start thinking about .Net, Linux, C#, or Ruby. When designing solutions, however,
you should hold off on the implementation details as long as you can.
Your design goal is to understand the requirements (functional and nonfunctional) fully and then to evaluate alternative solutions and implementations. If you focus too soon on platform capabilities, the platform may
begin to dictate your design, not only for a specific requirement, but also
for the requirements that follow.
Knowing the capabilities of a platform is important; but it is wise to hold
off deciding on one until you have your requirements and potential solutions on the table.
Design Is a Give-and-Take Process
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter17.xhtml
1/7
2/18/2020
Chapter 17 Designing Cloud-Based Solutions – Cloud Computing
Designing a system is challenging. Budgets and time constraints mean
you cannot solve every problem. That said, you need to consider the common design issues and then help the stakeholders prioritize the solutions
they desire. As you evaluate your system’s nonfunctional requirements,
remember the 80/20 rule (Often 80 percent of a program’s processing
takes place within 20 percent of the code). You will want to focus your
system design on the issues that will produce the greatest impact for the
stakeholders.
Designing for Accessibility
Depending on the processing a system performs, a designer may need to
create an interface that maximizes user access or may have to lock down
the system and control which users can access specific features. For a
public solution, such as a consumer website, maximizing user access not
only makes great marketing sense, but also may be required by law (see
the Americans with Disabilities Act website at www.ada.gov (http://www.ada.gov)).
In contrast, for a secure site, controlling user access can range from
ensuring the security of the login process to some type of biometric user
authentication.
CASE 17-1 VOICEPAY CLOUD-BASED USER AUTHENTICATION
Authenticating a mobile device user can be challenging. Often, mobile
users will preconfigure different pages to “remember” them in order to
simplify login processes. If a user loses the device, another person may be
able to access those pages. VoicePay, shown in FIGURE 17-1, has an
interesting voice-based biometric authentication capability. When a user
wants to make a purchase or log in to a specific site, the user calls VoicePay and speaks. The system, in turn, uses the user’s voice profile to authenticate him or her. The user does not have to provide a username,
password, or other confidential information—all he or she has to do is
speak. As mobile device use continues to grow exponentially, biometric
solutions such as those offered by VoicePay will become mainstream.
Exercise List and describe other potential uses for voice-based user
authentication.
Web Resources For more information on VoicePay, visit www.CloudBookContent.com/Chapter17/index.html
(http://www.CloudBookContent.com/Chapter17/index.html).
FIGURE 17-1 Using biometric voice recognition to identify users at
VoicePay.
CASE 17-2 WEB ACCESSIBILITY INITIATIVE
As discussed, designing for user access is not just good business—for
most web-based companies, it is a matter of law. To help designers understand potential solutions and user needs, the World Wide Web Consortium (W3C) has developed guidelines within its Web Accessibility Initiative pages, as shown in FIGURE 17-2. Before you begin a user interface design, you should review these accessibility issues and
requirements.
Exercise Research and discuss lawsuits that companies have lost for failing to support web accessibility for all users.
Web Resources For more information on the W3C Web Accessibility
Initiative, visit www.CloudBookContent.com/Chapter17/index.html
(http://www.CloudBookContent.com/Chapter17/index.html).
FIGURE 17-2 Specifics on designing web-based solutions to increase accessibility across a spectrum of users.
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter17.xhtml
2/7
2/18/2020
Chapter 17 Designing Cloud-Based Solutions – Cloud Computing
Designing for Audit
Chapter 15, Governing the Cloud, examined the cloud’s impact upon the
IT governance process. As you design a cloud-based solution, you must
first identify critical processing points at which you will want to place an
internal control to confirm that the solution’s processing is correct and
free from outside manipulation. You may design such controls to be active, meaning the code may generate a processing exception should unexpected results occur; or, the control may be passive, possibly logging
events to a file or saving snapshots of data.
In either case, it is important that you identify your audit processing
needs early so that the appropriate controls can be integrated into the implementation process and you can discuss and confirm your processing
needs with a potential cloud-solution provider.
Designing for Availability
As part of their service-level agreement (SLA), most cloud-based
providers guarantee system availability, normally specifying a percentage
of uptime, such as 99.9 percent. For most applications, 99.9 percent uptime is acceptable (this means that the system is down 0.1 percent of the
time, or 525 minutes each year). It is important that you identify your system’s uptime requirement and then, likely through the use of redundant
colocated servers, design a solution that meets your needs.
Designing for Backup
With the myriad of inexpensive high-capacity data-storage solutions
available within the cloud, loss of user data should not occur. If you are
designing your own solution, you must consider not only ways to back up
your data (and databases), but also the impact of each method on your
system availability should you need to bring down the system to restore a
backup.
Designing redundant data-storage solutions will always involve a costversus-risk trade-off. The issue is not whether you back up data—data
backups should be a given, always. The issue is aligning acceptable risk
mitigation with cost.
If you are designing a solution for which a third party (such as a software
as a solution (SaaS) provider) will manage your data, you need to understand the company’s backup policies and procedures, and even then you
will probably still want to integrate your own.
Designing for Existing and Future Capacity
Chapter 19, Application Scalability, examines the capacity planning
process. If you are moving an existing on-site solution to the cloud, you
should monitor the application closely to fully understand its processing
attributes, such as user demand, CPU utilization, RAM use, and data-storage consumption. Knowing your system’s current resource use, you can
better guess (it is difficult to predict system demand accurately) your system’s cloud resource needs.
With this knowledge, you can design for scalability—the ease of integrating additional computing resources. As you will learn in Chapter 19, there
are two primary ways you can scale an application. First, you can scale the
application up (called vertical scaling) by moving the application to a
faster, more powerful processor. Second, you can scale an application out
(called horizontal scaling) by distributing different tasks across different
servers. As you design a solution, you should identify opportunities to
leverage horizontal scaling. At a minimum, you should design your solution in such a way that you do not restrict future horizontal scaling
potential.
Designing for Configuration Management
Ideally, cloud-based solutions may be used at any time, from any place,
with any device. In practice, however, this means that developers must
consider a variety of operating systems, browsers, and device-specific
GUIs. Operating systems and browsers often require patches to address
security issues, and, eventually, each will face new version releases. If you
are designing your own solution, you will want to layer configuration solutions on top of your system. In this way, you will reduce the impact to a
computer-based user when changes are made to a handheld device interface or vice versa.
If your system design includes the use of an SaaS provider, you need to
know that company’s patch management and versioning policies and
procedures.
Designing for Deployment
Chapter 8, Virtualization, examined ways that desktop virtualization is
changing how solutions are delivered. From an operating system on demand, to thin client (browser-based) solutions, developers have a myriad
of ways to deploy a system. As you design a solution, you should identify
each potential user type and its environment attributes (such as operating
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter17.xhtml
3/7
2/18/2020
Chapter 17 Designing Cloud-Based Solutions – Cloud Computing
system, device type, and browser). Then, you need to consider not only
how you will deploy the initial solution to the user, but also how you will
deploy system upgrades.
Designing for Disaster Recovery
Chapter 10, Disaster Recovery and Business Continuity and the Cloud,
examined considerations for reducing the risk from a disaster and increasing the likelihood that a business is able to continue operating after
such an event. When designing a solution with respect to disaster recovery and business continuity, you must balance risks and costs. It is likely
impossible and unnecessary to protect a system from all potential events.
Instead, you must determine each event’s likelihood and business impact
and then seek to provide an affordable solution that mitigates risks. Fortunately, the cloud’s affordable and distributable resources provide developers with considerable flexibility.
Designing for the Environment (Green Computing)
Green computing describes environmentally friendly IT operations.
For example, replacing an application that prints reams of paper reports
with a browser-based performance dashboard is an example of a greencomputing initiative. As you have learned, within a data center, the biggest environmental impact is the power consumption to drive devices and
air conditioners. As more companies migrate to platform as a service
(PaaS) and infrastructure as a service (IaaS) providers, many smaller (and
possibly less efficient) data centers are being accumulated into larger,
state-of-the-art facilities.
As the capabilities of cloud-based collaboration tools continue to increase,
travel for face-to-face meetings will decrease, resulting in a lower business-related carbon footprint. That said, as solutions are made available
any place, any time, and from any device, the net result is a huge number
of handheld devices that are never powered off.
As green-computing practices continue to emerge, designers will be pressured to consider the environmental impact of their designs.
Designing for Interoperability
Cloud-based solutions are emerging for a wide range of applications.
Whereas just a few years ago, a company might have used one cloudbased solution for a customer relationship management (CRM) requirement, or a solution for an HR application, today, many companies use a
wide range of cloud-based solutions. To simplify the user interaction with
such solutions, many companies strive to integrate the solutions and often
even to share data across solutions. In the past, companies would buy and
install middleware software to facilitate the exchange of data between
solutions. Today, there are cloud-based middleware solutions that let
companies tie together two cloud-based solutions, often without the need
for programming development.
As you design cloud-based solutions, or when you work with an SaaS
provider, consider ways you may need to integrate data between applications and then design accordingly.
Designing for Maintainability
Designing and building software solutions is an expensive process. Usually, the most costly phase of the software development life cycle is the system maintenance phase. To maximize code reuse and to increase code
maintainability, software engineers are taught to create highly functional
(cohesive) and independent (loosely coupled) software modules. Chapter
11, Service-Oriented Architecture, discussed the role of cloud-based web
services to make solutions readily available to a variety of applications. By
decomposing an application into highly cohesive, loosely coupled modules
and then deploying those solutions to applications such as web services,
developers not only increase component reuse, but they also make the resulting systems easier to maintain by centralizing key processing as a distributed solution.
If you are using an SaaS solution, you need to keep the long-term nature
of your relationship in mind. Many people argue that cloud solutions are
initially inexpensive but may cost you more in the long run.
Designing for Performance
Speed matters. Across the cloud, you can find a myriad of companies that
will monitor your system performance and will estimate a percentage of
users who will leave your site if the pages do not load within 2 to 3 seconds. As you design the performance aspects of your solution, first you
need to identify the 20 percent of your system that will be used 80 percent
of the time. Then, you need to focus your initial performance optimizations there. Chapter 19, Application Scalability, looks at ways you can
scale a solution to meet user demand. Designing for performance and designing for scalability are two different issues. Designing for performance
means optimizing what you have. Designing for scalability means designing for the future integration of additional computing resources. The following are some ways that you can design for performance:
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter17.xhtml
4/7
2/18/2020
Chapter 17 Designing Cloud-Based Solutions – Cloud Computing
• Reduce the use of graphics on key pages.
• Optimize the graphics file format for all images.
• Compress large text blocks before downloading the text to a browser.
• Utilize data and application caching.
• Fine-tune disk and database I/O operations.
• Reduce, when possible, network operations.
• Fine-tune secure data communication transactions.
As you design solutions, evaluate them for potential bottlenecks as well as
for optimization points. Understand that you may not, due to time or budget constraints, have the ability to optimize everything.
Designing for Price
Budgets are a fact of life. As you design, you must be aware that your design decisions have financial implications. A solution that was inexpensive
to deploy may prove costly to maintain or vice versa. Just as you would
consider the performance or security aspects of each component you design, you must also consider each component’s short-term and long-term
budget impact.
Designing for Privacy
As discussed throughout this book, many users are not comfortable with
the idea of putting their data in the cloud. Cloud-based solutions must
protect a user’s data privacy. If you are developing a healthcare solution
with HIPAA requirements, an education solution with FERPA requirements, or an e-commerce solution that stores credit card information, you
will need to design your solution in a way that protects data not only from
external access, but also from internal users such as developers and
administrators.
Most designers understand the importance of backing up user data and
replicating key databases. It is important to note, however, that each data
backup creates a potential opportunity for a user, administrator, or hacker
to gain access to the data.
Designing for Portability
Portability is a measure of the ease with which a solution can be moved,
typically from one platform to another. Ideally, you should design your
system so that you can easily move the solution from one cloud provider
to another. Many developers argue that by using open source tools to create an application you increase the application’s portability. In reality,
within the cloud, developers using .Net will find many hosting opportunities beyond Microsoft—it’s a big cloud and solution providers want to service all developers. If you are designing your own solutions, be aware that
using a provider-specific application program interface (API), which may
not be available through other providers, may create a form of vendor
lock-in. Likewise, if you use an SaaS provider, be aware that each unique
or custom capability integrated into your solution may bind you to that
provider.
Designing for Recovery
We have discussed the need to design a solution to support disaster recovery and business continuity needs. Additionally, you should design your
solution with consideration for how you will recover from more common
events, such as server failure, user error, power outages, and so on. Your
recovery design should tie closely to your backup design and your system
redundancy design.
Designing for Reliability
Computing devices (disks, servers, routers, and so on) will eventually fail.
You have learned that many devices have an associated mean time between failures (MTBF) attribute that you can use to estimate the device’s
potential life expectancy. As you design your solutions, you must identify
potential signal points of failure and then design potential system redundancy or establish an acceptable system downtime.
Designing for Response Time
When you design a solution, you should keep the user experience in mind.
As discussed, users are conditioned to expect fast system response. In
fact, a large percentage of users will leave a site if they have to wait more
than a few seconds for pages to download and display. As you design a solution, you need to consider not only the page download times, but also
the system response time after a user performs an operation, such as submitting a form. Across the cloud, there are companies that specialize in
testing the user experience. These companies will evaluate a system from
different geographic locations, using different connection speeds, and
with a variety of browsers. Your response time design efforts may be
closely related to your site’s capacity plan design.
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter17.xhtml
5/7
2/18/2020
Chapter 17 Designing Cloud-Based Solutions – Cloud Computing
Designing for Robustness
Robustness is a measure of a site’s ability to continue operations in the
event of an error or system failure, such as a server failure or database error. Again, as you design you should strive to identify and eliminate single
points of failure. Furthermore, you should consider automating a system
resource utilization monitor that alerts administrators before a system’s
resources become critically low.
Designing for Security
Chapter 9, Securing the Cloud, looks at a variety of cloud-based security
issues developers must consider, including the following:
• Software patch installations and software version management
• HR vetting of cloud-based personnel
• Early awareness of security incidents and appropriate responses
• Data privacy issues and considerations
• Jurisdictional issues for a remote cloud-service provider
• Multitenant solution issues
• Cloud-provider failure or collapse
• Defense mechanisms for common low-level network attacks
• Data wiping for shared-storage space
• Physical security considerations
For each component you design, you must evaluate the component’s potential security exposure. Again, in some cases you will need to balance
risk and cost.
Designing for Testability
Cloud-based solutions will likely have a large number of functional and
nonfunctional requirements. As you design a solution, you need to keep in
mind how you will test various aspects of your design. As you might guess,
the system’s nonfunctional requirements are often the most difficult to
test. Depending on a system component’s purpose and functionality,
some developers will use a methodology called test-driven design by
which they first design and implement one or more test cases and then
build a solution that can satisfy the test.
Designing for Usability
To be of use a system must be usable. Usability, in the world of IT, is understood as a measure of a system’s ease of use. As you design a solution,
you must keep the user foremost in your mind. Because of the importance
of meeting system usability requirements, many designers will model or
create a prototype of the user experience so they can receive user feedback
early in the design process.
CHAPTER SUMMARY
Cloud-based systems will have functional requirements, which specify the
tasks the system must perform, and nonfunctional requirements, which
define the behind-the-scenes operational requirements the system must
satisfy. This chapter focused primarily on considerations a designer must
evaluate when addressing a system’s nonfunctional requirements for a
cloud-based solution. Designers must balance a large number of operational requirements with budget and time considerations. Initially, a designer should list the known requirements and then work with the stakeholders to focus on the requirements that will have the biggest positive
ROI.
KEY TERMS
Functional requirements
Green computing
Middleware
Nonfunctional requirements
Portability
System requirements
Usability
CHAPTER REVIEW
1. Compare and contrast functional and nonfunctional requirements and
provide an example of each.
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter17.xhtml
6/7
2/18/2020
Chapter 17 Designing Cloud-Based Solutions – Cloud Computing
2. Discuss why a designer should avoid selecting an implementation platform for as long as possible during the design process.
3. Discuss various trade-offs a designer may need to make with respect to
nonfunctional requirements.
4. Discuss why the system maintenance phase is often the most expensive
phase of the software development life cycle.
Settings / Support / Sign Out
© 2020 O’Reilly Media, Inc. Terms of Service / Privacy Policy
⏮
PREV
Chapter 16 Evaluating the Cloud’s Business Impact and Econo…
https://learning.oreilly.com/library/view/cloud-computing/9781449647407/Chapter17.xhtml
NEXT
Chapter 18 Coding Cloud-Based Applications
⏭
7/7