views:

71

answers:

3

To get a search website built quickly I plan to split the work between two teams: One to build the search engine and one to build web UIs (mobile/desktop). My plan is to build the search engine as a set of REST services based on .NET 3.5. UIs may be built using some other technology.

Questions: is the REST interface likely to be a performance bottleneck? How best to avoid this?

+1  A: 

REST is unlikley to be a bottleneck in this scenario. It wasn't clear from your post whether you were making REST calls directly from your HTML UI on the client, or whether you were making server-to-server REST calls on the back end. So I'll cover both cases below.

If your REST calls are being made between your client UI and your servers, then using REST or another HTTP remoting approach matters relatively little-- the time it takes to execute the search on the back end and then send the results back down to the client should dwarf the impact of the REST call itself. If you want to improve perf, focus on client-side networking tricks (e.g. HTTP Compression, proper caching headers, etc) and optimizing your search engine itself.

If your architecture is one tier of servers (hosting your web UI) calling another tier (your serach engine), then calling between those tiers over REST also shouldn't add too much to your overall latency. This is because (same as above) running the search and sending results back down to the client will usually take a few hundred milliseconds at least, and the overhead of the back-end REST call (if done properly) will usually be 50ms or less.

That said, it's easy to mess up the client end of server-to-server HTTP calls. For example, many HTTP Client libraries (including .NET's) will by default limit the number of concurrent client connections, which makes sense if you're building an actual client app but will kill your scalability if used from a "client" that's actually a server serving hundreds of users concurrently. Other potential problems include authentication issues, proxy problems, DNS, etc. So be careful to build and configure your REST client code carefully, and be sure to load-test with a few hundred concurrent users!

Justin Grant
Yes, the architecture will involve a server side presentation teir which calls the back end REST. Thanks for the tips on scaling - certainly important as this site needs to serve 2m page impressions a week.
domspurling
I would go even further and say why bother using REST to do the server to server communications. You already are using WCF, you control both sides of the interaction. Why not just define a WCF ServiceContract? REST is awesome to reduce coupling between client and server and HTTP is great for clients across the network, but if your servers are sitting right next to each other, why pay the cost?
Darrel Miller
WCF is what we'd normally go for but in this case we might have to be heterogeneous - can't assume MS throughout
domspurling
A: 

No. REST is not (and generally cannot be) a bottleneck. REST is HTTP without the fancy HTML page. It's cheaper and faster than a regular web page.

S.Lott
A: 

I think it should not effect your performance, but to have a proper use of REST service .Net has ASP.Net MVC which supports REST fully.

Do remember to read through this link http://www.ytechie.com/2008/10/aspnet-mvc-what-about-seo.html

Ravia
MVC supports some html-centric development, and just enough of HTTP for html or json driven applications. It doesn't support ReST fully anymore than any other framework that lets you access http headers and streams.
serialseb