Database Reference
In-Depth Information
Design Patterns
Let's review the important design patterns that use SQL Azure. Before designing your first cloud
application, you should read this section to become familiar with a few design options. Some of the
advanced design patterns explained in this chapter can also provide significant business value, although
they're more difficult to implement.
Note that for simplicity, the diagrams in this section show only a direct connection to SQL Azure.
However, virtually all the patterns can be implemented using a serviced connection through Azure
services.
Direct Connection
The direct connection pattern , shown in Figure 2-4, is perhaps the simplest form of connectivity to a SQL
Azure database. The consumer can be either an application located in a corporation's network or a
Windows Azure service connecting directly to the SQL Azure database.
Figure 2-4. Direct connection pattern
As simple as it is, this may be one of the most widely used patterns, because it requires no special
configuration or advanced integration technique. For example, a software as a service (SaaS) application
may use this pattern; in this case, the consumer is the web site hosted in Azure (or on any other hosting
provider). Alternatively, the consumer may be a smart device or a phone accessing records in SQL Azure.
Smart Branching
The smart branching pattern (see Figure 2-5) describes an application that contains sufficient logic to
determine whether the data it needs to load is located in the cloud or in a local database. The logic to
make this determination is either hardcoded in the application or driven from a configuration file. It
may also be provided by a data access layer (DAL) engine that contains logic that fetches data either a
local or a cloud database.
One of the uses for smart branching is to implement a form of caching in which the consumer
caches parts of its data locally or fetches it from a cloud database whenever necessary. You can also use
this pattern to implement a disconnected mode to your application, in case Internet connectivity
becomes unavailable.
Search WWH ::




Custom Search