Re: [dispatch] Proposal for Per Resource Events Protocol
Rahul Gupta <cxres@protonmail.com> Mon, 14 August 2023 10:45 UTC
Return-Path: <cxres@protonmail.com>
X-Original-To: dispatch@ietfa.amsl.com
Delivered-To: dispatch@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 178E6C15154C for <dispatch@ietfa.amsl.com>; Mon, 14 Aug 2023 03:45:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.104
X-Spam-Level:
X-Spam-Status: No, score=-2.104 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=protonmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lqH5gNtZbKW0 for <dispatch@ietfa.amsl.com>; Mon, 14 Aug 2023 03:45:29 -0700 (PDT)
Received: from mail-40135.protonmail.ch (mail-40135.protonmail.ch [185.70.40.135]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 49BD1C151547 for <dispatch@ietf.org>; Mon, 14 Aug 2023 03:45:29 -0700 (PDT)
Date: Mon, 14 Aug 2023 10:45:19 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1692009926; x=1692269126; bh=bYajMVLVdf3eNFdDgPJPab5uGF9aSOWTZ0vlPZs3XAU=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=JTxDrbVMpgwTpyuVAl6dXP6Lg5r0zsNBw1eUlvtr1/E37wLHGCre+gJ+DmVQ+w5d0 055MCkssZxImneWpT50uZGqkCkvxr3ceDYHQcD8JrYyqF+A96a1nVtU+xJfNWzmZKu IrBjxcrqy4GVSNAOEMxR2JxcuBnwMi1r4BNfq50rvrnsN2Yttu4v4AnRcZI3a8xWOw gaurQVvL0kzbT60nmrOo86euvUjt1j3mpFd9UKb9EIvJGWjOU0dEK/bLq8u7ugFC5h c3an9wZpc81N4lCTZcxQd2GAupsV7iVSYIXgswIHn0KJ1JnvxvTlFRpP+jtNpjkUCC 3XwKrhv3t1r4Q==
To: Michael Toomim <toomim@gmail.com>, "dispatch@ietf.org" <dispatch@ietf.org>
From: Rahul Gupta <cxres@protonmail.com>
Message-ID: <ln_nzgjeeIMYpT-0UFFwiuxUMJ2iNhU63nYmKWh-BYwTZ-eCKTCT1k-OvfVYVHmdvuxoAnQB9t49tYXsMct0geV3uy81C5jqbRwrPjybBt0=@protonmail.com>
In-Reply-To: <5ae3c5b6-d512-a961-51be-4cd919a6bcf4@gmail.com>
References: <878ralz3o1.fsf@hobgoblin.ariadne.com> <15c147ec-6628-6fc8-f31b-69d7269cb222@gmail.com> <SMMaN1Bg78cqanzppFhR0unkomG-MzlTY4noaVSCTyUpnBCwMyuzciRC3OnOQ5bi38DBLVvmUjzr05NREXES90ImoACH0-Ym0AOOZlXhd0I=@protonmail.com> <5ae3c5b6-d512-a961-51be-4cd919a6bcf4@gmail.com>
Feedback-ID: 919445:user:proton
MIME-Version: 1.0
Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha256"; boundary="------b287eb10c39800b67482943efdd6880d1803e984c9c27f2489702b783e6445af"; charset="utf-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/dispatch/la1CdwEbojGNQV4mDIJFOS1QGiw>
Subject: Re: [dispatch] Proposal for Per Resource Events Protocol
X-BeenThere: dispatch@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: DISPATCH Working Group Mail List <dispatch.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dispatch>, <mailto:dispatch-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dispatch/>
List-Post: <mailto:dispatch@ietf.org>
List-Help: <mailto:dispatch-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dispatch>, <mailto:dispatch-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 14 Aug 2023 10:45:34 -0000
Hi Michael, Replies are spread across posts. A few points of clarification in this one. Sent with Proton Mail secure email. ------- Original Message ------- On Sunday, August 13th, 2023 at 10:41 AM, Michael Toomim <toomim@gmail.com> wrote: > Rahul: > > > Michael, would you be open to 15-20 minute call? I can both explain myself and understand from you how Braid works a bit better. > > Yes, definitely! It's a pleasure to meet you! I spoke with Tim Berners-Lee this summer, and he got me excited to integrate Braid subscriptions with Solid as well. Let's definitely set up a call and make some stuff work! > > > > It's not clear to me how Per-Resource Events differs from SSE, for example. > > > > In SSE, you dedicate a resource as endpoint for notifications. > > I agree that it's better to use a single endpoint for state and its notifications. Braid-HTTP does this too. However, to be fair to SSE, it does support a single URL for both state and its updates. SSE requests are distinguished by the `Accept: text/event-stream` header, which means you can overload every URL in your app with an SSE notification stream for it by looking for that header. That is true. Except, I have not seen one implementation in the wild do this with SSE (The connection limits issue is a factor for this). Ditto for WebSockets. In fact, my first stab at this problem was to define a new media type `multipart/notifications` with its parameters being used for content negotiation (thus not locking a client to `text/event-stream`). But I found that solution does not scale when if we are to define more protocols after PREP. > On the other hand, SSE does require two requests per resource here— one to GET the resource, and another one to get the updates. It's nice to reduce this to a single request, and Braid-HTTP does this too. > > You can see an example Braid-HTTP request in the Subscriptions section here: https://datatracker.ietf.org/doc/html/draft-toomim-httpbis-braid-http#section-3 > > First it returns the current state of the resource, and then the connection is left open, and it streams updates to the resource that have occurred since it was first returned. > > > > Braid supports per-resource events that describe *mutations to state.* I would be curious to learn if you have use-cases for events beyond mutations to state. > > > > I am not exactly sure of what you mean by "mutations of state", but messages are sent in PREP typically when an HTTP operation occurs, like PUT or POST (these can be redefined for a media-type, see Appendix A). For example, POST might not change the current resource, but create another resource. Still, a notification might be sent for the resource/URI where POST was done. > > Here's what I mean by "mutations of state": > > > Backgorund: REST stands for REpresentational State Transfer. Each URL has state. When the state of a URL changes, that is a mutation of state. > > Now, there's a hierarchy of specificity that an HTTP event stream specification might operate at: > > 1. Byte stream: A stream of bytes to be parsed (e.g. TCP) > 2. Event stream: A stream of discrete separate events, possibly with event IDs (e.g. SSE, WebSocket) > 3. Pub/sub stream: A stream of pub events that can be subscribed to > 4. Mutations: Subscribing specifically to changes to the resource's state (e.g. Braid-HTTP) > 5. Formatted mutations: Subscribing to mutations expressed in a particular change format (e.g. Braid-HTTP w/ Range Patch) > This is really helpful. PREP operates at level 5 with the change formats defined as separate specifications. See Appendix A where I define one using `rfc822/messages`. I'll be defining one for Solid in the next few weeks, once some issues are resolved with Solid Notifications (the idea being `application/ld+json` notifications will be consistent with Solid). We can easily do the same for mutations as Braid describes (with the benefit that the same would likely work for protocols that supersede/compete PREP). > Braid-HTTP is specifically designed to express levels 4 and 5: mutations to state. These are by far the most common use-case for event streams, and it's important to have a standard for them. Otherwise, we end up with a standard that's not very useful for interoperability in real web apps. MNot describes some of this here. > > I've been curious if PREP is trying to address any use-cases for event streams beyond mutations of state. If not, then we should merge our efforts (and I'll advocate for operating at level 5). If so, I'd love to hear what the use-case is, to know what Braid-HTTP isn't handling. I guess our use cases are very much similar, except two caveats: 1. Clients might want to opt into only notifications without versioning and write mutations (But Braid does not force you to opt-in to those things, so this is a non-issue). 2. Clients might want to watch creation of new resources/URIs by subscribing to an existing resource (I am not sure how Braid deals with this). > Any PUT request is a mutation of state. A POST request usually creates or mutates state, and you can subscribe to the resulting mutation with Braid-HTTP, too. So I suspect that we are tackling the same use-cases. > > I am very glad that we're getting connected. Thanks a bunch of taking initiative on this important work! Likewise! > Michael BR/Rahul
- [dispatch] Proposal for Per Resource Events Proto… Rahul Gupta
- Re: [dispatch] Proposal for Per Resource Events P… worley
- Re: [dispatch] Proposal for Per Resource Events P… Michael Toomim
- [dispatch] Fw: Re: Proposal for Per Resource Even… Rahul Gupta
- Re: [dispatch] Proposal for Per Resource Events P… Rahul Gupta
- Re: [dispatch] Proposal for Per Resource Events P… worley
- Re: [dispatch] Fw: Re: Proposal for Per Resource … Michael Toomim
- Re: [dispatch] Proposal for Per Resource Events P… Michael Toomim
- Re: [dispatch] Proposal for Per Resource Events P… Michael Toomim
- Re: [dispatch] Proposal for Per Resource Events P… Tim Bray
- Re: [dispatch] Proposal for Per Resource Events P… Rahul Gupta
- Re: [dispatch] Proposal for Per Resource Events P… Rahul Gupta
- Re: [dispatch] Proposal for Per Resource Events P… Michael Toomim
- Re: [dispatch] Proposal for Per Resource Events P… worley
- Re: [dispatch] Proposal for Per Resource Events P… Michael Toomim
- Re: [dispatch] Proposal for Per Resource Events P… worley
- Re: [dispatch] Proposal for Per Resource Events P… Michael Toomim
- Re: [dispatch] Proposal for Per Resource Events P… worley
- Re: [dispatch] Proposal for Per Resource Events P… Michael Toomim
- Re: [dispatch] Proposal for Per Resource Events P… Rahul Gupta
- Re: [dispatch] Proposal for Per Resource Events P… Rahul Gupta
- Re: [dispatch] Proposal for Per Resource Events P… worley
- Re: [dispatch] Proposal for Per Resource Events P… Rahul Gupta
- Re: [dispatch] Proposal for Per Resource Events P… Kévin Dunglas
- Re: [dispatch] Proposal for Per Resource Events P… Rahul Gupta
- Re: [dispatch] Proposal for Per Resource Events P… Michael Toomim
- Re: [dispatch] Proposal for Per Resource Events P… Kévin Dunglas