Click here to Skip to main content
15,791,758 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Which of the two approaches is better suited for implementing a high-performing REST Service to be hosted on IIS-7 - IHttpHandler or IHttpModule?

I'm mostly interested in which of the two scales best, i.e. fastest to respond, with the least of resources to use.

Would the need for authentication have any impact on making the choice?

I've read a few articles here about differences between the two, but it's still difficult to see if use of one will offer any benefit over the other when implementing a high-performing REST service. It probably takes to write one to find out.

To put it differently... if we need to implement a REST service to process more than 1000 light requests per second, which of the following approaches is the best one?

  • WCF
  • IHttpHandler
  • IHttpModule
Updated 5-Oct-12 6:17am
RaisKazi 5-Oct-12 12:00pm    
Interesting Question. Voted 5!

1 solution

It depends what you're trying to achieve - what do you want the Handler \ Module to do?

Up until recently, we've been using the MVC framework to provide RESTful services - it's really simple to setup & maintain, performs well and has everything we need.

Otherwise, you may want to look at the new Web API in .Net 4.5

Creating a REST service using ASP.NET Web API[^]

Alternatively, you can have a look at ServiceStack - I hear good things about this, but haven't used myself[^]
Share this answer
Vitaly Tomilov 5-Oct-12 12:24pm    
What I'm trying to achieve: As stated, I need a REST service capable of scaling to process more than 1000 requests per second. The service will use some basic caching mechanism to assure response without delay and fire the response at once. Both requests and responses are tiny.

I would never consider MVC's overhead for such task. I'm looking for the best performing approach.
Vitaly Tomilov 5-Oct-12 12:30pm    
After this I went through the ServiceStack and could see that it is based on use of IHttpHandler. From their configuration samples:

<add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>

My question was on a lower level, as you see.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900