Thursday, June 12, 2014

Introduction to Project Katana

In one of my previous posts, I wrote about OWIN and in this post I am going to write about Project Katana. To get a good understanding about Project Katana, I suggest you have some knowledge in what OWIN is.

So assuming you have some knowledge in OWIN, you should know by now that OWIN is a specification which is owned by the community and it's not owned by Microsoft.  It’s not any kind of an implementation, just some list of principles defining an standard interface between .NET web servers and web applications.

So where does this Project Katana comes in. Let’s find out.

Project Katana

The Project Katana is Microsoft’s implementation of OWIN. As you know OWIN describes the whole application as a collection of four layers which are “Host”,”OWIN”,”Application Framework/Middleware” and “Application.”. In Project Katana what Microsoft has done is following the OWIN specification, they have came across many components for each of above mentioned layers. The core concept is, they are not coupled with one another.

So you might be wondering what is the reason for such decoupling.


As you might already know, ASP.NET was first released in early 2002 with the release of .NET 1.0.

ASP.NET was shipped as part of the .NET Framework. Which means a newer version of ASP.NET will only be available when newer .NET Framework is released. But the issue was, the world of web was growing so fast and ASP.NET has not been able to catch up with that growth.

The another thing is everything in ASP.NET was bundled into this one assembly which is “System.Web”. Because of this tight coupling of ASP.NET with “System.Web”, the assembly got bigger and bigger as Microsoft updates or introduces features for ASP.NET.

And because of this tightly coupling, there was a major performance hit. All the options were enabled by default and users were paying money and time to process unwanted options. And most importantly because of this tightly coupling, the only hosting option was IIS.

As the first step towards change, in year 2007/2008, Microsoft shipped ASP.NET MVC separated from the .NET Framework. ASP.NET MVC was released as an independent download through Nuget and it gave the Microsoft, the flexibility to deliver updates much more frequently than had been previously possible.

In 2012, ASP.NET Web API was released. ASP.NET Web API was designed in such a manner that there is no dependencies on anything on “System.Web” and therefore, no dependencies to IIS and ASP.NET Web API included the capability to run in a custom host (for example, a console application, Windows service, etc.). By decoupling framework components from one another and then releasing them on NuGet, frameworks could now iterate more independently and more quickly.

Katana Components

If you can remember OWIN describes an ASP.NET application as a collection of four layers which are “Host”,”Server”,”Application Framework/Middleware” and “Application.”. So the Katana components for these would be as belows.
  • Application
    • ASP.NET MVC Application
  • Application Framework / Middleware
    • SignalR
    • ASP.NET Web API
  • Server
    • SystemWeb
    • HttpListener
    • WebListener
  • Host
    • IIS
    • OwinHost.exe
    • Custom Process
So that’s an introduction to Project Katana. Appreciate your feedback.

Happy Coding.


No comments:

Post a Comment