Re: [dispatch] Proposal for Per Resource Events Protocol
Tim Bray <tbray@textuality.com> Sun, 13 August 2023 06:28 UTC
Return-Path: <tbray@textuality.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 0B253C151524 for <dispatch@ietfa.amsl.com>; Sat, 12 Aug 2023 23:28:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.106
X-Spam-Level:
X-Spam-Status: No, score=-2.106 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=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 (1024-bit key) header.d=textuality.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 4OhtNM7s27gA for <dispatch@ietfa.amsl.com>; Sat, 12 Aug 2023 23:28:53 -0700 (PDT)
Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 86414C15109F for <dispatch@ietf.org>; Sat, 12 Aug 2023 23:28:53 -0700 (PDT)
Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-99bdcade7fbso433614166b.1 for <dispatch@ietf.org>; Sat, 12 Aug 2023 23:28:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=textuality.com; s=google; t=1691908132; x=1692512932; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/TVKtxI948uBOTqYRrwpk39YGWRFxCtZB4oKbxdeqp4=; b=Sefzr3IvMI3Aaxa6/IPvQTscitBs0HJZUOYmg7h7UsRgveyadkRbm8J3gPdo0jQJ8g NczaF2UE5jsC1EzipwC+eH8wZG9PTPHiISiBlY1dnACEHRMWwRIqsK/zsgjuR5kKzpQh /OcXLFDCY7pfrYEUXvT8MiyopivhjchwYbt/4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691908132; x=1692512932; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/TVKtxI948uBOTqYRrwpk39YGWRFxCtZB4oKbxdeqp4=; b=XUA+DLmvhYEb0u1qX37S5DaPePD7hFLofxa9kpX67b7tyoFKvSHZ2QTTthUyvvGL9t jTRD10AMTjkOrzi2sJt3Ak2avXyByeqf+W4aG367nY+7EBei3MF2HD34BiZ/jdq/Mzpy ziNEzIm+3DffhexTiOqRsLwSaIKpyLiUBkVxotilJzPRMOByn65zv8NV/s0PYx+kPIbO 32obVK1ucUW9jBqU1vtBiyNtFyh/XBsbLPaXExf6bSXp6MDzJyVGMAdrqqKhvo6JQ7H/ C2ynB23mqoFvT+LqTKpAtyfeZjWGYzHLB0gmVp2nu7ZwjvW1yXU02YVOfSTzs0j/P5HQ aKZg==
X-Gm-Message-State: AOJu0Yy+P36gWRdBpdR2iC43hvCUNIXE6ir44KapEs2PDB24IiO+eSp+ d6PEPm+P6GZEkAElz8ZsDjLOxNRIt8+dQSqTjyXSxA==
X-Google-Smtp-Source: AGHT+IFIYS6VbB0lq8MH2rs2Ti8RW+sdviD4oITrkJqjpEjrHPLL/6iomJWtk2t0I9fBEQQyCHoNStG1Xz2C9GS1jtI=
X-Received: by 2002:a17:907:2c6a:b0:993:fb68:ed67 with SMTP id ib10-20020a1709072c6a00b00993fb68ed67mr4648387ejc.24.1691908131387; Sat, 12 Aug 2023 23:28:51 -0700 (PDT)
Received: from 1064022179695 named unknown by gmailapi.google.com with HTTPREST; Sat, 12 Aug 2023 23:28:50 -0700
Received: from 1064022179695 named unknown by gmailapi.google.com with HTTPREST; Sat, 12 Aug 2023 23:28:47 -0700
Mime-Version: 1.0 (Mimestream 1.0.5)
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>
In-Reply-To: <5ae3c5b6-d512-a961-51be-4cd919a6bcf4@gmail.com>
From: Tim Bray <tbray@textuality.com>
Date: Sat, 12 Aug 2023 23:28:50 -0700
Message-ID: <CAHBU6iumz+uAvoEyvcXJzio0zQbw75cfiiFS08b_BEWQZBqqqQ@mail.gmail.com>
To: Michael Toomim <toomim@gmail.com>
Cc: Rahul Gupta <cxres@protonmail.com>, "dispatch@ietf.org" <dispatch@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000002a0f5b0602c80f60"
Archived-At: <https://mailarchive.ietf.org/arch/msg/dispatch/tbMfTIwOfee_sSxVsbImvGk1iao>
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: Sun, 13 Aug 2023 06:28:58 -0000
Haven’t been following this that closely, but just thought I should mention, in case nobody else has, CloudEvents (from CNCF, Cloud Native Computing Federation, best-known for k8s): https://cloudevents.io/ While I was working at Amazon I led the design and implemented lots of parts of a product called EventBridge, which has been very successful for AWS: https://aws.amazon.com/eventbridge/ Which is to say, there’s quite a bit of existing state of the art here that could possibly be re-used. I can testify from personal experience that event streams are in practice super useful. Attaching this idea to the Web’s notion of a resource seems like a good idea. On Aug 12, 2023 at 10:11:29 PM, 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. > > 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) > > 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 > <https://www.mnot.net/blog/2022/02/20/websockets>. > > 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. > > 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! > > Michael > > _______________________________________________ > dispatch mailing list > dispatch@ietf.org > https://www.ietf.org/mailman/listinfo/dispatch >
- [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