tags:

views:

131

answers:

3

I'm designing a system that will need to move multi-GB backup images over TCP, and I'm looking at REST as an alternative to ONC RPC.

For example, I might have

POST http://site/backups/image1

where image1 is an 50GB file whose data is contained in the HTTP body.

My question: is this within the scope of what REST is meant for? Is it inappropriate to move massive files over HTTP? My preliminary testing shows that the performance isn't too bad, and I like the clean, debuggable protocol, as opposed to a custom ONC RPC server. But is this overloading the role of a webserver?

Thanks, -Steve

+1  A: 

HTTP has about the same overheads as FTP.

An HTTP server if often asked to do more work than an FTP server. But otherwise, using HTTP to send a large file is about the same as using FTP.

The only consideration is making sure your web server and web application framework are configured to do this kind of thing without needlessly expanding the entire 50Gb file inside Apache.

S.Lott
+1  A: 

Steve,

HTTP has a look-before-you-leap 'feature' that allows the client to ask the server whether it will accept the data submission before it actually sends out the data. I'd look into using this to avoid transferring GBs of data only to find out that the server is currently not willing to handle them. Look at the HTTP Expect header and 100 Continue status codes.

Also, you can use FTP within a RESTful approach, IOW, think along the lines of

<backup-store href="ftp://example.org/site/backup/images/"/>

and make your clients understand the ftp URI scheme.

Finally, the T in HTTP means transfer and not transport - an important distinction to make because the former is an application semantic (HTTP is an application protocol) and the latter is a not.

HTH,

Jan

Jan Algermissen
Thanks for the input, Jan. Could you elaborate on the transfer vs. transport distinction? Are you talking about the network stack?
Steve
It is a common misconception (of the WS-* camp anyway) that HTTP is a transport protocol and that other protocols can/should be layered on top of it. Transport protocols are used to transport the messages of application protocols and in the case of HTTP the transport is usually TCP. HTTP OTH is an application protocol - its operations have application semantics. Using HTTP as transport means that you loose the application semantics (e.g. caching) without any gain at all. Famous example is for example the tunneling of write operations through GET: when a crawler does its GETs many writes occur.
Jan Algermissen
A: 

REST has nothing to do with how large your data is or which method you use to transport it.

Rob
OK, REST over HTTP then?
Steve
Sorry Steve but you need to look at Roy Fielding's dissertation or Google for the RestWiki to better understand REST and why your question doesn't make sense in relation to REST.
Rob
You'll need to be more specific than that. The other commenters understood what I'm getting at based on my description, so I'm not sure what statement you're having problems with. Maybe I shouldn't have used the word transport.
Steve
The answers you're getting have nothing to do with REST and all about transferring data from the server, none of which is directly related to REST. How to address that resource is related but I don't see anything else in this thread REST related. And the answer from Algermissen is flat out wrong (clients needing to understand the scheme to implement the method is definitely unRESTful).Like I said in my first response, a reading of Fielding's chapter five or the RESTWiki will clear things up.
Rob