Blogbody Rotating Header Image

REST too complicated?

Danny asks if REST is too complicated. Funny, because I think the main problem with REST-style architeture is that it is too simple. The main problem is that you can’t easily express operations that aren’t simple CRUD. For example, queries are a bit more difficult. Sure, in HTTP REST implementations, you can use query strings, but for those of you that have actually used an HTTP-based REST architecture (I have at Spoke), it becomes difficult to expression complex queries using HTTP query strings.

Agree? Disagree? Share your experiences.

3 Comments on “REST too complicated?”

  1. #1 Tom
    on Sep 26th, 2005 at 8:08 am

    I’d rephrase the problem with an emphasis on documents. Sometimes you want the data factored in different ways. You sometimes want only part of a list. You might want to update one field across many records. But REST emphasizes working with whole (and single) documents.

    You can still have virtual documents defined by queries I guess, and GET and PUT those, but it seems like a stretch. Why not try to adapt a more traditional language already designed to tackle these problems? (Fine-grained security on SQL could be an interesting client option?)

  2. #2 Doug Marcey
    on Sep 26th, 2005 at 2:56 pm

    I’m not sure I’d agree that REST is no good for queries, I think it’s just very differnt. In my view, a query is a request for the server to create a search. I’m working on a system right now that does REST Queries. I have it setup such that if a user submits (via and HTTP Post) an xml query document to a /query addres the site returns a link to the query results (e.g. /query/12). The is very expressive (the query language is an xml doc) and follows the REST concepts very well (IMHO).

    In fact it has really simplified the way we do queries in our system, before there were several different “kinds” of queries and the users had been complaining about it being too complicated. By sticking to a single interface and using the XML doc approach (with javascript building that doc on the browser side) we’ve really ended up with a much cleaner implementation.

    Thinking of a search as a document also allows for some other interesting use cases (e.g. saved searches, reporting, etc.). In my mind a document doesn’t always need to be the same in REST (e.g. the contents of a search could be updated each time it is read, it just looks like it lives in a static place) but it can be useful to think of things in terms of documents as representations of your data.

  3. #3 Danny
    on Sep 28th, 2005 at 4:13 pm

    This essay from Dan Connolly in 1997 may be of interest, he talks of the Web as:

    “the minimum amount of distributed object technology necessary to get the job done”

    http://www.w3.org/People/Connolly/9703-web-apps-essay.html

Leave a Comment