Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0 service REST
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 2:26am
Edited 5-Oct-12 6:17am
v4
Comments
RaisKazi at 5-Oct-12 12:00pm
   
Interesting Question. Voted 5!

1 solution

Rate this: bad
good
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
 
http://www.servicestack.net/[^]
  Permalink  
Comments
Vitaly Tomilov at 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 at 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:
 
<system.web>
<httpHandlers>
<add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>
</httpHandlers>
</system.web>
 
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
0 OriginalGriff 270
1 Sergey Alexandrovich Kryukov 185
2 BillWoodruff 173
3 CPallini 155
4 Kamal Rocks 144
0 OriginalGriff 5,655
1 DamithSL 4,506
2 Maciej Los 3,997
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 5 Oct 2012
Copyright © CodeProject, 1999-2014
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