9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Uriel <uriel99@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] 9P writes for directories
Date: Sat, 28 Mar 2009 02:36:29 +0100	[thread overview]
Message-ID: <5d375e920903271836u674ea674x52dbe10e0491a8d8@mail.gmail.com> (raw)
In-Reply-To: <822E5D94-A700-4A8F-9B3D-B354AEFF6789@sun.com>

Some of us have been thinking about a 'sane' subset of HTTP plus some
conventions, that could reasonably map to 9p.

The main issue is the huge amounts of crud in the HTTP spec and how to
pick the sensible bits and discard the rest while remaining compatible
with existing implementations; the main convention that needs to be
added is a way to list directory contents, likely using something not
too insane, like JSON.

With some thought and care one could come up with a very simple,
RESTful, and almost 9p-mappable replacement for the stinking bloated
WebDAV and SOAP/XML-RPC abominations.

uriel

On Thu, Mar 26, 2009 at 11:05 PM, Roman Shaposhnik <rvs@sun.com> wrote:
> On Mar 26, 2009, at 1:54 PM, Eric Van Hensbergen wrote:
>>>
>>> I have thought about that too, but became convinced that POST is more
>>> like create (or more like write on a subdirectory -- hence the original
>>> question). With the clone operation it is the *opening* of the clone
>>> device that provides you with a new fid. In HTTP that would be like
>>> getting
>>> a redirection on GET. Don't you think?
>>>
>>
>> Except that Creates give an ID/path for creation instead of receiving
>> one -- that's the key thing that makes it like clone, the most
>> important bit being that this sort of mechanism avoids collision.
>
> I believe we're on the same page, but the wording is  not always
> accurate.
>
>> Whether or not that is critical depends on how you write your app.  I
>> think the main difference here is you are trying to map HTTP syntax to
>> 9P syntax, and I've been thinking of semantics -- an HTTP POST to a
>> subdirectory would equal the opening of a clone file (within that
>> subdirectory), and writing the metadata,
>
> Interesting point. I guess it all depends on what is the model for
> new nodes to be created in the URI tree. In fact, if I were to complete
> the analogy, then POST to an existing URI (although, nothing really exists
> in the world of URIs) corresponding to a "subdirectory" would be, in fact,
> what you say. A POST/PUT to a non-existing URI could be considered
> a creation of the named resource in its parent. Although I'm not sure that
> such a thing should be always allowed.
>
>> a read on that file would
>> return the ID -- this would be done atomically by the HTTP server to
>> service the POST not as a set of HTTP routines.
>
> If you mean PRG (http://en.wikipedia.org/wiki/Post/Redirect/Get) then
> yes.
>
>> I think the critical aspect from the REST/CRUD perspective is that the
>> POST
>> has to be idempotent
>
> Not as per HTTP RFC:
>    http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5
>
>>>> Outside of the ID bit, why wouldn't create suffice?
>>>
>>> It would (just as Erik pointed out). I guess I was just looking for
>>> symmetry (if POST is really a write(*), it should translate into write
>>> independent of whether the URI corresponds to a subdirectory or
>>> not) and potential pitfalls that made 9P spec disallow writes on
>>> subdirectories (and since nobody can identify any of those -- I'll
>>> rest my case and proceed with translating POST into different
>>> 9P messages depending on the type of the URI).
>>>
>>
>> I don't think the symmetry is worth altering the semantics of the
>> protocol -- its likely more trouble than its worth in the long run.
>
> Agreed.
>
> Thanks,
> Roman.
>
> P.S. I wonder if there's a general interest in REST from the Plan9
> folks. I've seen your blog post on the subject, so there's that. It is
> actually quite fun to see how things like Google App Engine and
> http://konstrukt.dk/, etc can reap the same benefits from the elegance
> of FS-aware design. Could it be that with the right approach
> (lib9p/libixp plugin for apache?) writing web services could be
> as much fun as writing filesystems for Plan9?
>



  reply	other threads:[~2009-03-28  1:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-21  7:00 Roman Shaposhnik
2009-03-26 19:31 ` Roman Shaposhnik
2009-03-26 19:35   ` erik quanstrom
2009-03-26 19:50     ` Roman Shaposhnik
2009-03-26 19:56       ` erik quanstrom
2009-03-26 19:44   ` Eric Van Hensbergen
2009-03-26 20:23     ` Roman Shaposhnik
2009-03-26 20:52       ` erik quanstrom
2009-03-26 20:54       ` Eric Van Hensbergen
2009-03-26 22:05         ` Roman Shaposhnik
2009-03-28  1:36           ` Uriel [this message]
2009-03-28  4:03             ` Roman Shaposhnik
2009-04-19 16:43             ` Enrico Weigelt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d375e920903271836u674ea674x52dbe10e0491a8d8@mail.gmail.com \
    --to=uriel99@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).