RE: Mnot's Pub/Sub for the Web

Mike Bishop <mbishop@evequefou.be> Tue, 22 February 2022 21:25 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0E3783A07F3 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 22 Feb 2022 13:25:03 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.647
X-Spam-Level:
X-Spam-Status: No, score=-2.647 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=evequefou.onmicrosoft.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 07FtFVA9hYgW for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 22 Feb 2022 13:24:57 -0800 (PST)
Received: from lyra.w3.org (lyra.w3.org [128.30.52.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C19973A06E7 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 22 Feb 2022 13:24:57 -0800 (PST)
Received: from lists by lyra.w3.org with local (Exim 4.92) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1nMcc2-00058z-FT for ietf-http-wg-dist@listhub.w3.org; Tue, 22 Feb 2022 21:22:22 +0000
Resent-Date: Tue, 22 Feb 2022 21:22:22 +0000
Resent-Message-Id: <E1nMcc2-00058z-FT@lyra.w3.org>
Received: from mimas.w3.org ([128.30.52.79]) by lyra.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <mbishop@evequefou.be>) id 1nMcbz-00057z-8p for ietf-http-wg@listhub.w3.org; Tue, 22 Feb 2022 21:22:19 +0000
Received: from mail-mw2nam10on2136.outbound.protection.outlook.com ([40.107.94.136] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by mimas.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <mbishop@evequefou.be>) id 1nMcbv-0000ov-Tb for ietf-http-wg@w3.org; Tue, 22 Feb 2022 21:22:19 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U1w30d9xlf/+wR9wdhulYl0L/0/IsbSbUtCOZkw39Ahi4b0gWhWuaIorj3XRg7Wkh8CmfcDbSlr7l7vVivvMu1R8lUdoLoG0ZmANoVX3Ql2e0NcJjeT8xptXhbo872SUxpHF794khHgRAP4hm3PZby3Nw6Gs00d4iSOgYzbiqkXITZdikatet2g53F13ed0z4NdT+5CSQg8ZRnH4OuHsPhG+ObJ9Tc+gmVyDXMKuGpFYNREBFBvK/y3/8sTFMP4D3AHXEVF1XNnHzxbeak87aPfe7TQe6xY50t9pGmkcpAufZFZ7aG2/cvNimCjsPMGU/wmfeIF/+XotFzR34DYZuQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0i4SZDz2l4Z9ZDK4RIiCLYVvqIyweHcw1BnDbiJiYBM=; b=WiZowzf8mo4k8q3kF8wJG2gklOh3sQtyn2BFJiK1g5r/+YYiDVJrt5rNxshorBqh5MgAnd65YDTdGINQVPB/ftwxvhXjQJh/1gutzp/z6DW2XO1rRq9sVylhCoRIH1M/yXaFOjeJzkALv1E8IP9Er5lxKZjVqyUoqZ2KKJDq7B3byngHDZ/wAHmCCaVwmYeDHqyczEOaNf5ypZAjcxIM96rrSesLGPTrsXeUahh+O+8qNqVDcpwzoDtewaf6s5YY/qdT+8mAqzevksWTZcBPH3mQqpphIrntspKcJf41GjFiBZzYMEG6a2W52/Sylaccj13bpjqBVfynr7HWOu6p7g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=evequefou.be; dmarc=pass action=none header.from=evequefou.be; dkim=pass header.d=evequefou.be; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=evequefou.onmicrosoft.com; s=selector2-evequefou-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0i4SZDz2l4Z9ZDK4RIiCLYVvqIyweHcw1BnDbiJiYBM=; b=brtw7ns36kNFv2dgI2YsgSg8MztylMy86Emen3QL8qR2Stu2kgz6lKlg2/9h1oDJ6xKq/h+CJmBxw1+vzdaXPWURu2OSiInIRLri/4K0fHQzv/DHToqm8vYA9NUXDZMk/Mn9Z0jf7umz4MeoUa4O7FHCTReYme1NKE/9EW2l/Ns=
Received: from PH0PR22MB3102.namprd22.prod.outlook.com (2603:10b6:510:143::15) by CO1PR22MB2801.namprd22.prod.outlook.com (2603:10b6:303:150::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.15; Tue, 22 Feb 2022 21:22:03 +0000
Received: from PH0PR22MB3102.namprd22.prod.outlook.com ([fe80::fd7b:8939:4103:b117]) by PH0PR22MB3102.namprd22.prod.outlook.com ([fe80::fd7b:8939:4103:b117%3]) with mapi id 15.20.4951.017; Tue, 22 Feb 2022 21:22:02 +0000
From: Mike Bishop <mbishop@evequefou.be>
To: Kévin Dunglas <kevin@dunglas.fr>, Michael Toomim <toomim@gmail.com>
CC: HTTP Working Group <ietf-http-wg@w3.org>, Mark Nottingham <mnot@mnot.net>
Thread-Topic: Mnot's Pub/Sub for the Web
Thread-Index: AQHYJj2+u7RqnGRnuE6GGOwxQqc9A6yf3lUAgAA4luA=
Date: Tue, 22 Feb 2022 21:22:02 +0000
Message-ID: <PH0PR22MB3102FCEEB29C1084899DBC6DDA3B9@PH0PR22MB3102.namprd22.prod.outlook.com>
References: <8a75a96a-286d-9260-498f-0b7dd8260156@gmail.com> <CADU7aos5T=hhPvtDz1aUAQ8PrZtFYwGVPp40se+yP=i2hFbZ0Q@mail.gmail.com>
In-Reply-To: <CADU7aos5T=hhPvtDz1aUAQ8PrZtFYwGVPp40se+yP=i2hFbZ0Q@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=evequefou.be;
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 4c135391-e1f9-4e5e-dc86-08d9f6495e9a
x-ms-traffictypediagnostic: CO1PR22MB2801:EE_
x-microsoft-antispam-prvs: <CO1PR22MB28013CDF2930656129767287DA3B9@CO1PR22MB2801.namprd22.prod.outlook.com>
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: pErWvB8o18pwLIf5Ui2QqXr76QwbFtjBnPzDwrL89ymTp33hUC+ZeXdU6sxUgcnCr3XbgjTcqzoXz0v+Ikj9ddinc39vKB5B+AmPsC7bu87ePOhoGDVNZmqQV7qtixdFWH2hx2q6nUyg6eOhHinU4dS3ZKcaJpHGzEup94Vs99di0aDMOrd8adEAK5OcRNpV0EIBd7b14fJ3plMQs0eo5ATBcmuj0oexVmViruVs/2r++EXsmncJj9Lj3AfrIMbJI/JM+tvxzJDKTff6HskZhvBLeFgUKdzWBCP1E5h9BfCasr2jkgoTrVMFxjiAn9f7JI3ZAhAExOv2RoZPO9m0mBFXUEKeHRWOTYDqjiFGISnMzCKMr+4vu3Rmc8xrsFIdcHYo1do+9ZSRVkuedzF4lBvUKiYZ2XI3VXfrCFdAtHSldzVWquVnyWXp9YZkKRC7QoHsMYwDc0QQzqGDZoGLuH39zY1a6ufhLJtx1X1xQhrub4UF+Nu70Cichlt56O8Wn9PKmF7ub17UxMU9RqfnEMnX8s4BzmA3KCjECrNTS/JPR8+lRxplKGRtOXwiGPDOoFSM30JMOgt0YvGjxN4SssuT4w/Cy6rNm0fF4k+ZWuYfTkMA8AtDVPz/eEQ+/ldK7mwV8PtNL68F2LfDxmJYp3QaclMSFkAk2X+mj9Q7OIZmqY8OCmNd7S70CFNfwHNeQv491OHtCpe+huSME3gUXktTBBQZk8Dur8OTqESIFXLtVFAVikKOT+j4T8dRIc65YjgnTSK0+I+G/Ce9fTuycDhifC2BAuu/AykSzQAa6mw=
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR22MB3102.namprd22.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(396003)(376002)(136003)(39830400003)(346002)(166002)(6506007)(76116006)(26005)(7696005)(9686003)(508600001)(55016003)(54906003)(122000001)(66574015)(186003)(66946007)(71200400001)(110136005)(52536014)(53546011)(5660300002)(38100700002)(33656002)(86362001)(38070700005)(66446008)(8936002)(66556008)(64756008)(966005)(2906002)(4326008)(316002)(66476007)(83380400001)(8676002);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: Dblv3A26HE8jlWRQGJvWaVWhH4VhBFUEogAS3XTWQf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ilkc9Eybw61mByP+CADFK3i+3n1Ji1etBlxUD7+nmDnoI0z2+sOrVdm7AAhUVC7L4ZNd/YiYU53trCHvmjxsCzy7ZHbApDFtg4VC618hw2/cv1PetDpo1KJgVMqWPscQd5u9qA7+Vw74z6B1GdayO4EvM+oXGgrynhkB9u+GhZFpLIzAyZbMdtQGHyE528ZaJO4nMefkOGTrSqBJj0N11POampUdkXzLEeF3WB5Yy1zWANFFhw1Pb3fbha5Rz7gAxETpKI/8l5n5Z7k8sW0LHLgDZdobij77+WH8v3qoF18GNFIYnP8LZzxh6CpOIUYen0Ubh+0tR8JZtuzivS3jcmJ6Vyi+rpPcsCGzcy52Twe3T3w3baPNRak2YiMWzf5QtDiNxFjr4WBj1FHO9wCKagXrNEO3rrK3ir5QaGQGzo06t1qbSGhdhA6hGTglhaY45U674REnxNfM5EsEwZITFRuweVKyU4e9encv7AGXxtg==
Content-Type: multipart/alternative; boundary="_000_PH0PR22MB3102FCEEB29C1084899DBC6DDA3B9PH0PR22MB3102namp_"
MIME-Version: 1.0
X-OriginatorOrg: evequefou.be
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: PH0PR22MB3102.namprd22.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4c135391-e1f9-4e5e-dc86-08d9f6495e9a
X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Feb 2022 21:22:02.8170 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 41eaf50b-882d-47eb-8c4c-0b5b76a9da8f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: IRhMcy4pl8JfCG/jtuNawjixkAU4uO8ME1VnHYuSum/Vf6xEFT21tapn1C+fectdhwq4PkmhQe4OppASUo+5jg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR22MB2801
Received-SPF: pass client-ip=40.107.94.136; envelope-from=mbishop@evequefou.be; helo=NAM10-MW2-obe.outbound.protection.outlook.com
X-W3C-Hub-DKIM-Status: validation passed: (address=mbishop@evequefou.be domain=evequefou.onmicrosoft.com), signature is good
X-W3C-Hub-Spam-Status: No, score=-3.9
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: mimas.w3.org 1nMcbv-0000ov-Tb 08f78592d31405d73eb7f06d85a12e22
X-Original-To: ietf-http-wg@w3.org
Subject: RE: Mnot's Pub/Sub for the Web
Archived-At: <https://www.w3.org/mid/PH0PR22MB3102FCEEB29C1084899DBC6DDA3B9@PH0PR22MB3102.namprd22.prod.outlook.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/39849
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <https://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

This is a very interesting space, and I’m glad we have two such solid contenders.  I’m not convinced this fits squarely within HTTP’s mandate, as this seems more like a protocol on top of HTTP than a pure extension to HTTP.  Perhaps like OHAI, there might be enough interest to warrant a dedicated working group?

From: Kévin Dunglas <kevin@dunglas.fr>
Sent: Tuesday, February 22, 2022 12:56 PM
To: Michael Toomim <toomim@gmail.com>
Cc: HTTP Working Group <ietf-http-wg@w3.org>; Mark Nottingham <mnot@mnot.net>
Subject: Re: Mnot's Pub/Sub for the Web

Thanks for bringing this topic to the list again!

On the Mercure side, the spec has stabilized. Several open-source and proprietary implementations are available (https://mercure.rocks/spec#implementation-status), and adoption is growing: 2.7K stars on GitHub, dozens of open source projects using it, large companies publicly declaring use...

Many new use cases have been reported on the bug tracker over the years, and we improved the spec to cover most of them. Some minor issues still need to be handled (https://github.com/dunglas/mercure/labels/spec), but we're very soon to publish the final version of the specification.

As demonstrated by the discussions on Hacker News, Mark's great article, and by the adoption of Mercure, the community is in demand of a pub/sub standard for web resources.

Even if most discussions occurred on GitHub, Slack, Twitter, and other channels instead of on IETF mailing lists, the Mercure spec is now implemented by production-grade "running code" and has reached "rough consensus".

Mercure is less ambitious than Braid. Its scope is more limited. It is focusing on providing a simple pub/sub protocol for web content proved working with the current web infrastructure (web browsers, proxies,, firewalls, etc). In its current state, it doesn't require any JS library or polyfill client-side.

The spec is very similar to the WebSub specification from the W3C, but mainly targets web browsers instead of servers. As WebSub, Mercure uses a hub to distribute web resources, which allows implementing the protocol easily even in legacy applications, with languages not designed to handle long-living connections (e.g. PHP), and when using modern infrastructure such as serverless and edge computing platforms (https://dunglas.fr/2019/07/mercure-real-time-apis-for-serverless-and-beyond/). Unlike WebSub, Mercure natively supports authorization, end-to-end encryption, and state reconciliation. Both clients and servers can be publishers.

Currently, Mercure only allows using SSE as transport, but we'll maybe allow using other transports such as WebSockets and Web Transports, probably as extensions to the current spec, to cover use case such as transmitting non-base64-encoded binary data (https://github.com/dunglas/mercure/issues/616).

Braid is very interesting and has a much broader scope (state synchronization, P2P, etc). It also requires more changes to the current software stack to be natively supported by the web platform. Mercure overlaps only with the "subscribe" feature of Braid, and I've the feeling than Braid could use Mercure (and probably WebSub too) for its subscribe feature, at least in a first iteration.

I wonder how we can move forward regarding the standardization of a pub/sub protocol for web content and web browsers. Even if Mercure gained traction outside of the IETF, it hasn't on this group. I was thinking about proposing the final version of the spec as an independent-track RFC, or to the W3C as it is very close to WebSub, and is also related to the other specs published by the Social Web Working Group (ActivityPub, and even Solid). But as the this topic is discussed again, maybe could we work on a pub/sub protocol here?



On Sun, Feb 20, 2022 at 10:39 AM Michael Toomim <toomim@gmail.com<mailto:toomim@gmail.com>> wrote:

Hello, HTTP!

Today Mark Nottingham posted a great articulation of the issues programmers face when choosing between using SSE, WebSockets, and WebTransports:

https://www.mnot.net/blog/2022/02/20/websockets

I'll attempt to summarize Mark's beautiful insight as: in almost all cases, what the programmer *really* wants is a Pub/Sub protocol, not an arbitrary socket. And we could standardize a Pub/Sub protocol, and that would have great benefits.

These benefits are real and I think could improve performance dramatically. CDNs could cache realtime updates, not just static data.

However, I'll take Mnot one further, and propose that when a programmer is choosing a Pub/Sub protocol, what he *really* wants is a State Synchronization protocol, not an arbitrary Pub/Sub protocol.

He wants to Subscribe specifically to *state updates*. He wants to Publish specifically *updates to state*.

What we need is not a general Pub/Sub standard, but specifically a State Synchronization standard. State Synchronization is a constrained type of general Pub/Sub. And we'll need to constrain Pub/Sub in this way to address some of the issues Mark brings up, such as:

> There are also some architectural/philosophical concerns about how non-final responses **relate to the state of the resource**.

The relationship between a server's "responses" and the "state of the resource" is what a State Synchronization protocol defines. And, in fact, we have two proposed solutions to State Synchronization in the IETF!

Braid:         https://datatracker.ietf.org/doc/html/draft-toomim-httpbis-braid-http
Mercure:    https://datatracker.ietf.org/doc/draft-dunglas-mercure/

I am seeing a growing awareness that HTTP needs to add State Synchronization abilities, as well as excitement about the new fundamental power it gives programmers on the web.

These protocols transform HTTP from a State *Transfer* into a State *Synchronization* protocol. Whereas a transfer protocol can move a resource from server to client in a single request/response, it requires an application programmer to take over if the resource ever changes after the response completes. That sucks for programmers. A synchronization protocol provides a much better programming abstraction. The programmer just says "I want state X", and can assume it will be kept up-to-date by the protocol.

If we standardize this, we also get CDNs that automatically cache dynamic content (the stuff currently hidden within websockets), just as easily as they cache static content today. We get collaborative editing and offline modes available in web apps for free. We also take an important step towards decentralizing the web, by creating an open standard for the trickiest part of decentralized app development — data synchronization — that is compatible with P2P CRDT and OT algorithms.

Since this all seems to be coming together, I would like to know what HTTPbis as a group thinks. Is there interest in this topic?

If so, what aspects might we want to work on?