Designing Scalable IIS Applications

The most important thing to keep in mind when beginning a Web application development project is that Web applications are, for the most part, server applications. Historically, server software has been second only to operating system internals in complexity and programming difficulty. IIS and Windows offer a variety of innovative tools that make Web application development much faster and easier, but the concerns and challenges of server software programming still exist.

Performance

In the world of single-user desktop software development, the performance requirements are clearly defined. In that context, it is important that the user does not experience a significant delay when performing common tasks.

In the early years of the World Wide Web, slow Web pages were commonplace, and for many users a long wait was tolerated. However, as more and more enterprise Web applications were created, the requirements for Web application performance began to rival those of the single-user desktop. Today, with faster communication technologies becoming prevalent, users are demanding greater increases in site performance.

Scalability

The real issue in Web application design is that while the application appears to the single user as a traditional desktop application, it is actually a distributed application that could be simultaneously servicing hundreds or even thousands of users.

Web applications demand performance under a wide range of environment conditions-in other words, they must be scalable. Certainly, Web applications must perform well, but good performance when being used by a single user does not necessarily translate into scalability.

There are many different metrics for determining how scalable an application is. A truly scalable Web application should be able to do the following things:

  • Serve a single user as well as it can serve hundreds or thousands of simultaneous users.

  • Perform twice as well when installed on a computer with twice the resources (processors, RAM, and so on), perform three times as well on a computer with three times the resources, and so on.

Of course, these scalability requirements are ideals. However, the closer your application comes to fulfilling those ideals, the more successful your application will be when under load.

Design Considerations for Performance and Scalability

The following considerations are important for making your application scalable:

  • Technology Choices: As with any development platform, Windows offers a number of options for completing a given task. Making the correct choice of technologies is the first, and often most important, step in designing a scalable Web application. For example, if a client-side technology provides the same or similar functionality as provided on the server, the client-side option often makes more sense; as the application is more scalable because the client handles much of the processing load. Proper technology choices can also lead to fewer round-trips between the client and server, further improving performance. For more information, see IIS Architecture Overview and the Internet Client SDK.

  • Language Choices: Choosing a development language impacts your Web application by defining the range of users who have access to it. For example, including scripting in an application will exclude users who have browsers that do not support scripting. The following development languages are available:

    Windows Script Components

    Visual Basic

    Java

    C++

  • Algorithm and Work Flow Design: Even the proper technology, if used improperly, will yield poor results.

  • Multithreading: IIS and Windows provides a multithreaded environment, and in order to create scalable applications, you must choose the appropriate threading model for your components.

  • Resource Contention and Delay: Resource contention and leakage are often major culprits behind applications that cannot scale.

  • "Real-World" Testing: You must be sure to thoroughly test your Web application in an environment that approximates the actual environment in which the application will be deployed.

  • Security: Security measures often impact performance and scalability. For example, if you write ASP pages that accept user input, your Web site performs a fraction slower if you validate all user input before risking to send it on to your other Web components. However, security measures should always come first, regardless of how interesting you think your Web site is to malicious attackers.