Windows Server AppFabric

After a recent conversation with a few folks on the AppFabric (AF) team and them saying to me “What? You’re not using AF? Really? Well what are you waiting for?” I figured it was about time I looked into it. Truth be told I’ve been more involved with Windows Azure (“To the cloud!”) as most organizations that I’ve been dealing with appear to be more concerned with connecting their applications and services to Windows Azure as opposed to procuring additional server hardware. That said, I decided to jump off the diving board and plunge head first into this pool of technology bliss.

Doing a quick search on the Microsoft site, I successfully installed the latest bits of AppFabric (AF) within a virtual machine (VM) running Windows Server 2008 SP2 that I’ve been using for a myriad of things. There are two installs (web and direct); both work with the former being geared more towards a development machine vs. the latter which is more suitable for a server (additional configuration is required). This process couldn’t be simpler and the AF wizard makes it extremely easy to update configurations.

I created 2 SQL Server 2008 databases for the monitoring and persistence aspect of AF (although both could be combined into one) which then provides the ability to view events via an IIS dashboard.

Wanting to conduct some testing, I created a sample WCF service and ASP.Net web site to validate that AF was available and running, which it was. Using Visual Studio’s built in templates for both made this a trivial process. Note: This works for Windows Workflow (WF) as well.

Diving deeper into the dashboard, it provides a "Tracked Events View" that displays event data within IIS manager. This view lets you customize the query that is sent to the monitoring database using common filters. From the dashboard, you can use this view to see the latest events that have been tracked, and then customize your query. Alternatively, you can click on any of the metrics displayed in the "WCF Call History"and "WF Instance History"sections, and a pre-created query will be used to save you time. For example, you could click the "Exceptions" metric then the resulting query would just show event data that contains exception information.

The main pane within the "Tracked Events View" displays a table of events that match the current query. The sortable columns in the table provide a high level summary of what the events mean. You can also right click rows in the table to get a context menu that provides useful tasks such as relating an event to a tracked Workflow instance. This is useful when you want to get events from an operation that spanned multiple services, maybe even different machines, as long as they are sharing the same monitoring database.

When an event is selected in the main pane, the Details Paneat the bottom of the view displays information that was captured with the selected event. This includes custom event properties, environment information, tracked variables (for Workflow Services), and Error details (if applicable).

As mentioned earlier, the query that is used to retrieve event data from the monitoring database can be customized. You would do this using the "Query Summary"control at the top of the "Tracked Events View." Using this control, you can filter by several common criteria such as "Emit Time", "Event Type", "End To End Activity Id", and "Tracked Variables (Workflow only)."

Looking at the architecture it’s evident that substantial work went into AF and that this will certainly be an improvement since it removes the difficulty in building a custom caching/hosting model while saving time in the process. Some of the benefits of using Windows Server AppFabric are:

Manage services and workflows

  • Infrastructure for enhanced workflow and service hosting, configuration, and control
  • Integration with IIS Manager and PowerShell to manage and monitor workflows and services

Monitor services and workflows

  • Infrastructure for storing workflow and service monitoring information
  • Dashboard for service and workflow instance health

Distributed in-memory application cache

  • Caches any serializable CLR object and provides access through simple cache APIs
  • Supports enterprise scale: tens to hundreds of computers
  • Provides seamless integration with ASP.NET

Server/Service Symmetry

  • Symmetric service development
  • Implementation of common scale-out and availability fabric

So where does this leave us with AF? Well, Windows Server AppFabric improves performance, availability, scale, and management of web and composite applications. One of the great benefits it provides to web developers is the ability to easily make existing ASP.NET web applications faster and more scalable, through distributed in-memory caching and replication technology that works with current ASP.NET applications. It also simplifies the development of composite applications with the pre-built application services for service and workflow hosting, used in conjunction with Visual Studio tools and .NET Framework capabilities (ASP.NET, WCF and WF). IT Pros can also simplify the deployment, monitoring, and management of composite applications with configuration and monitoring capabilities that are integrated with familiar tools (PowerShell, IIS Manager, and System Center).

Finally, Windows Server AppFabric delivers elastic scale, performance, availability, and reliability (benefits often associated with the cloud [e.g. Azure]). So if you haven’t started using AF, come on in as the waters fine!

Additional Resources

Training for Developers

AppFabric Development Center

WCF Development Center

WF Development Center