8

I am designing a RESTful web service. It will include some GET and POST requests. I am a bit confused whether the web service can benefit from SPDY protocol. I intend to use Ruby on Rails for the implementation. Are there any gems that support SPDY?

dknight
  • 1,243
  • 10
  • 23

2 Answers2

10

Potentially, yes.

One of the major design goals of SPDY is to reduce and amount of latency associated with each request. The way this is accomplished is by enabling multiplexing over the same TCP connection. Additionally, SPDY does header compression, which is a big win especially for REST style interactions which often cary very small (JSON) payloads, but send large HTTP headers (cookies, etc).

So, would SPDY give you a performance boost? It depends on your application, but there are specific optimizations within SPDY which should definitely help.

As far as "gems" for Ruby. There is the spdy gem which parses the protocol, but you shouldn't need it. SPDY is a layer below HTTP and should be mostly handled for you by the server. If you're interested in experimenting with it and you're using Rails, I would recommend trying Passenger + mod_spdy.

igrigorik
  • 9,433
  • 2
  • 29
  • 30
0

SPDY has nothing to do with the application itself. If you're using Apache, check mod_spdy. There is also SPDY daemon for rack.

Sam Dark
  • 5,291
  • 1
  • 34
  • 52
  • I understand that SPDY does not have to do anything with the application itself; but I am interested in exploring the possibility that if we use SPDY instead of HTTP there might be some performance boost. – dknight Jun 07 '12 at 15:40
  • 1
    There should be performance boost for batch operations like getting 100 posts in a blog one by one. – Sam Dark Jun 08 '12 at 12:49