Windows Azure allows you to select a geographic location
for your Windows Azure services so that you can host your application
close to your users. This section describes how Tailspin uses this
feature in the Surveys application.
Note:
The Surveys application is a “geo-aware” service.
1. Goals and Requirements
Tailspin wants to allow
subscribers to the Surveys service to be able to specify which
geo-specific instance of the Surveys application they’d like to use. For
example, a U.S.–based customer would probably want to choose a
U.S.–based service, and a European customer would probably want to
choose a European-based service. However, it’s possible that a
subscriber might want to run a survey in a different geographic region
than the one the subscriber is located in. Figure 1 shows how a U.S.–based subscriber might want to run a survey in Europe:
2. Overview of the Solution
Hosting a survey in a web role in a different geographic location
doesn’t, by itself, mean that people filling out the survey will see
the best response times when they use the site. To render the survey,
the application must
retrieve the survey definition from storage, and the application must
save the completed survey results to storage. If, in the example shown
in Figure 3-1,
the application storage is in the U.S. data center, there is little
benefit to European customers accessing a website hosted in the European
data center.
Figure 2 shows how Tailspin designed the application to handle this scenario and resolve the issue just described.
The following describes the steps illustrated in Figure 2:
The subscriber designs the survey, and the application saves the definition in storage hosted in the U.S. data center.
The Surveys
application pushes the survey definition to another application
instance in a European data center. This needs to happen only once.
Survey
respondents in Europe fill out the survey, and the application saves
the data to storage hosted in the European data center.
The
application transfers the survey results data back to storage in the
U.S. data center, where it is available to the subscriber for analysis.
In some scenarios, it may
make sense to pre-process or summarize the data in the region where it’s
collected and transfer back only the summarized data to reduce
bandwidth costs. For the Surveys application, Tailspin decided to move
all the data back to the subscriber’s region; this simplifies the
implementation, helps to optimize the paging feature, and ensures that
each response is moved between data centers only once.
Note:
When
you deploy a Windows Azure application, you can select the subregion
(which, at the moment, determines the data center) where you want to
host the application. You can also define affinity groups that you can
use to group inter-dependent Windows Azure applications and storage
accounts together in order to improve performance and reduce costs.
Performance improves because Windows Azure co-locates members of the
affinity group in the same data center. This reduces costs because data
transfers within the same data center do not incur bandwidth charges.
Affinity groups offer a small advantage over simply selecting the same
subregion for your hosted services, because Windows Azure makes a “best
effort” to optimize the location of those services.