ISAPI and the Web Application Architecture
Strengths of ISAPI
The set of interfaces that make up ISAPI were designed to provide application developers with a powerful way to extend the functionality of IIS. ISAPI extensions and filters have the following advantages over some of the other Web application technologies available:
- Highest performance: A properly planned, developed, and used ISAPI—particularly ISAPI extensions—can outperform any other Web application technology available currently for IIS.
- Low-level control: From an ISAPI extension or filter, you have access to the whole array of Win32 API functions. For instance, you can create a customized worker-thread pool for your ISAPI extension to speed processing, using the Win32 thread functions to access the native thread functionality of Windows 2000.
Often, ISAPI extensions and filters are best positioned to solve critical bottlenecks in your Web application—especially if you expect scalability to be an important issue for your application, due to high traffic volumes. For instance, if you would like to create your own Web search application on IIS, creating the actual search engine with ISAPI might be the best option if fast performance is an important goal.
Cautions
In many cases, ISAPI can provide you with the best-performing solution possible. However, there are several caveats to keep in mind:
- Development requires more time: Because ISAPI extensions and filters are usually written in C or C++, the development time is longer than that for, say, an ASP page.
- Scalability gains are not necessarily automatic: Although ISAPI extensions and filters will generally run faster than their ASP and server-side component counterparts, there is no guarantee of perfect scalability. For more information on creating scalable ISAPI extensions and filters, see Designing High-Performance ISAPI Applications.
- ISAPI operates below helpful IIS infrastructure: Certain helpful programming abstractions, most notably the session abstraction, are effectively absent in ISAPI programming, which is lower-level than scripting. In addition, interactions with COM objects must also be handled carefully—more carefully than if you were creating a Web application out of server-side components and ASP script.
If these caveats more than counterbalance the benefits of choosing ISAPI for a Web application component, then perhaps ASP scripting and server-side COM components would be more appropriate for you.
For more specifics about developing extensions and filters, see Developing ISAPI Extensions and Developing ISAPI Filters.