Physical Deployment & Operational Requirements

Summary

Deploying Application Components

The layers described so far (presentation, business and database) are simply a convenient way to describe the logical grouping of related components. They are conceptual rather than physical divisions. How you deploy the actual DLLs into tiers is driven by how the layers interact with each other and the different requirements they have in terms of security, operations, and communication. How you deploy applications depends on many factors such as the kind of the application being deployed (ASP.NET vs. Windows Forms), the user base of the application, scalability, performance requirements, organizational policies, and other factors. In general, a number of physical deployment patterns can be identified for specific kinds of applications, especially Internet-base applications.

Physical tiers represent the physical division between the components of your application, and may or may not map directly to the logical tiers or layers used to abstract the different kinds of functionality in the application. Physical tiers may be separated by firewalls or other security boundaries to create different units of security context. There are two main families of physical tiers - farms and clusters. A farm consists of identically configured and extendable set of servers sharing the workload, whereas a clusters is a specialized set of servers designed to handle failures of individual servers gracefully.

In general, a number of common infrastructure deployment blocks can be found in many application deployment environments:

Web Farms

A web-farm is a load-balanced set of web servers. A number of technologies can be used to implement load-balancing solutions including hardware solutions (Cisco, Nortel switches and routers), and software solutions such as NLB which is a feature of Windows Servers. In either case, the principle is the same: a user makes a request, and the request is services by one of the available servers, and if one server fails, the load-balancing solution (whether hardware of software) will remove the failed server from the list of available servers. Load-balancing can achieve high scalability and availability when incoming requests have no affinity to any server, i.e., requests can be serviced by any server.

Consider the following issues when designing web-based solutions that will be deployed in a web-farm:

Application Farms

Application farms are similar to Web farms but they are used to load-balance requests for business components across multiple application servers. If your business components are designed to be stateless, you can implement load-balancing using Windows Network Load Balancing (NLB) as each request can be serviced by any of the identically configured servers in the farm.

Database Clusters

Database clusters are used to provide high availability of database servers. When designing .NET applications that will connect to a database hosted in a cluster, you should take extra care to open and close connections as you need them, and not hold on to open connection objects. This ensures that ADO.NET can reconnect to the active database-server node in case of a failover in the cluster.

Rich/Thin Clients

You can also deploy components to rich clients. Rich clients usually imply the ability to authenticate users as well as the ability to maintain session-related state in memory. On the other hand, thin clients manage HTML or even simpler UI models, so they are not typically considered a deployment target for your components.

Planning Physical Location of Application Components

As an application architect, one of the most important decisions to take will be where to physically deploy components in your application. As with all aspect of application architecture, physical deployment decisions involve trade-offs between performance, reusability, security, and many other factors. Enterprise policies in large companies can also affect your deployment decisions. As an example of how physical deployment affects application architecture, you may decide that business-critical data should not be accessed from components exposed to the Internet - they should only be accessed from a separate layer of components operating from behind a firewall. The following sections discuss overall issues relating to physical deployment of application components:

Factors Affecting Deployment

When deciding on the physical architecture, keep one thing in mind: distributing components results in a performance hit. The decision to deploy components together or distribute them is affected by the following general factors:

Security

Consider the following security factors when deciding how to deploy components:

 Management

Consider the following management factors when deciding how to deploy components:

Performance, Availability, and Scalability

Consider the following communication factors when deciding how to deploy components:

Distribution Boundaries Between Components

Planning UI deployment

In Windows Forms, user process components should be deployed together with their UI components. In ASP.NET, user process components should be deployed along with ASP.NET pages on the IIS server. User process components should be deployed in a .NET assembly separate from the associated UI to facilitate reuse and maintainability.

Planning Business Component Deployment

Consider the following recommendations:

Planning Service Interface and Service Agent Deployment

Service interfaces and service agents receive calls from, and make calls to external services and applications. These external services and application may be located anywhere. Service interfaces can be deployed together with business components and workflows, or they can be deployed remotely. If service interfaces and/or service agents require a connection to the Internet or a less trusted environment, a separate physical tier may provide the required security.

Planning Data Access Component Deployment

Deploying data access components with the components that use them yields the following advantages:

Data access components are usually used by business components, but may also be used by UI or user process components. For Web scenarios, it is recommended that data access components be deployed together with the user UI pages, especially if the UI takes advantage of DataReader streaming.

Partitioning Application or Service into Assemblies

.NET assemblies are units of deployment. The assemblies you create and how components are distributed in them can have a long-term impact on how the application is developed, deployed, managed, and updated. Many factors affect how you distribute components into assemblies. Note the following recommendations for partitioning applications/services into assemblies:

Packaging and Distributing Application Components

To distribute an application, you must package it and deploy it. There are multiple options:

Common Deployment Patterns

In the discussions below, the figures reference component types and not assemblies. The following patterns are discussed:

Web-Based UI

Web Farm with Local Business Logic

Notes:

Web Farm with Remote Business Logic

Note:

Rich Client UI

Rich Client with Remote Components

Notes:

Rich Client with Web Service Access

Notes:

Service Integration

Service Agents/Interfaces with Local Business Components

Notes:

Service Agents/Interfaces with Remote Business Components

Notes:

Enterprise Application Integration Clusters

Notes:

Composing Deployment Scenarios

As particular scenarios may vary, the examples given above can be combined to produce a hybrid infrastructure for a layered application. The important thing is to follow the conceptual model given previously and to understand the application, infrastructure design, and how they affect each other in the application lifecycle.

References