The following best practices, presented in no particular order, are recommended for creating scalable applications.
Follow the five commandments of designing for scalability
When making design decisions, keep the following in mind:
For more information, see Designing for Scalability.
Use clustering technologies
Clustering features include Network Load Balancing (NLB), Cluster Service, and Component Load Balancing (CLB). Network Load Balancing, which acts as a front-end cluster that distributes incoming IP traffic across a cluster of up to 32 servers, is ideal for enabling incremental scalability and outstanding availability for e-commerce Web sites. Cluster Service, which acts as a back-end cluster, provides high availability for applications such as databases, messaging, and file and print services. CLB distributes workload across multiple servers running a site's business logic. It complements both NLB and Cluster Service by acting on the middle tier of a multitiered, clustered network. For more information, see Windows Clustering.
Consider logical versus physical tiers
When designing a distributed application, logical separation should always be considered. Always logically partition your application between the user interface layer, business logic layer, and the data layer. Although logical separation does not mandate physical separation, it makes physical separation possible. By partitioning your application to enable physical separation, you can achieve scalability by scaling out your application across several machines. For more information, see: Duwamish 7.0 Architectural Overview and Fitch and Mather 7.0 Architectural Overview.
Isolate transactional methods
Separate transactional methods from nontransactional methods. Placing nontransactional methods in a component that requires a transaction for its transactional methods will negatively impact the scalability of that component because calls to either class of method incurs the overhead of a transaction. For more information, see: Transaction Implementation in Duwamish 7.0 and Heterogeneous Distributed Transaction Implementation in Fitch and Mather 7.0.
Eliminate business logic layer state when possible
By making the business logic layer as stateless as possible, you increase the scalability of the layer. A component in the business logic layer that must maintain state between calls consumes resources. Multiply this fact by the number of potential clients and the amount of resources consumed increases, along with the likelihood that resource contention will occur. Such a component greatly complicates the ability of the application to scale out.
Read Designing for Scalability with Microsoft Windows DNA
Sundblad, Sten, and Per Sundblad. Designing for Scalability with Microsoft Windows DNA. Redmond, WA: Microsoft Press, 2000.
This book describes major technologies associated with using the Windows DNA model to develop scalable enterprise applications. Many of the concepts and methodologies presented in this book are equally applicable when building applications with the .NET Framework.
Review the Best Practices for Performance
Scalability and performance are closely entwined. In addition to the practices listed here, review the Best Practices for Performance.
See Also
Scalability