Click here to Skip to main content
13,148,427 members (61,785 online)
Rate this:
Please Sign up or sign in to 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

Posted 5-Oct-12 1:26am
Updated 5-Oct-12 5:17am
RaisKazi 5-Oct-12 12:00pm
Interesting Question. Voted 5!

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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[^]
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170924.2 | Last Updated 5 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100