Re: [dispatch] Proposal for Per Resource Events Protocol

Michael Toomim <toomim@gmail.com> Mon, 14 August 2023 20:35 UTC

Return-Path: <toomim@gmail.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 973ACC14CEFA for <dispatch@ietfa.amsl.com>; Mon, 14 Aug 2023 13:35:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.195
X-Spam-Level:
X-Spam-Status: No, score=-7.195 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, NICE_REPLY_A=-0.091, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, 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=gmail.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 C9Y2o40Pnw41 for <dispatch@ietfa.amsl.com>; Mon, 14 Aug 2023 13:35:49 -0700 (PDT)
Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) (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 5CB06C1524AC for <dispatch@ietf.org>; Mon, 14 Aug 2023 13:35:49 -0700 (PDT)
Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1bc3d94d40fso41056645ad.3 for <dispatch@ietf.org>; Mon, 14 Aug 2023 13:35:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692045348; x=1692650148; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=fjt0hMdgNIbm5pvpdRguNy2w4CvYuKdjF1b/xG1YHUU=; b=jqoyZ+UQCU16e+eSYROkvM+uLUSC9VJmnEbBGhwCyBjSSZgGTfvIpRJPG23cnHMVhJ jIaYXRi39ethbpfUUSIFnjzRFgQlgaXusRDb1614ibrhf+gDTc4PzAPfALP/nIV5qB5i Oc6boRLLoB9TYxW79enMmiidZ6CXzcL/9KTQX4nlfE7h7gdmV02P8tqQDMpeqaFsbS3A soW3oEiV2/mGZzuLg1DS7LOnav8R7mNUy6rhW6but4D9FEZiTrcraEmpDtVuTWNottEF 8kvd27JxSycMNGTYr6O3C07aKhXeX8UAAD9ZeUKPwrz1q5CQ4bXs5ctuU24bANuobDpF 03OA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692045348; x=1692650148; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=fjt0hMdgNIbm5pvpdRguNy2w4CvYuKdjF1b/xG1YHUU=; b=THJHuoFjM88PW8z/7zawydowRGVNNHWI++0wPPFR6Dt2sdtJ3jUW9CleDH9pxnHfBC SbS4FFH25XRGe0AEF2rxOcupEH8vUqvV8a+3H4BG8PNqV65Px5iX+Vr1GS6Mmy70bw2e usiZydIU706YpZZlJk+ltIXEe3L8tnXNWYdDqBOi8QR8PrfpptvM5co3v7i9iWt2vUn/ WncEf02f+d8di0stZlpP1ghh1IExFowiFwUr1IfnkInJPsr89/vZmcRGiVJk2eErV5Ou dAeWWmdBN5LYQ1gtPPUy72UwIsjhqGskRXtA0PKwiksDJSxD1i9/9qja9fZZP8V2IEhl aQxw==
X-Gm-Message-State: AOJu0Yw/Nn6E/jAMV4nnM10q9A9CTO4E8EzlgA1qzGxeetVl3j2hODw3 8WzxNteXW+zVopjyo5FS6bUY+3BI/Yk=
X-Google-Smtp-Source: AGHT+IEdLMs0l+O68rHseUrpCAO9VYE5gkj9VjVTbrTeeuguvm/rY14h1j7oZ7nKZ005NhjEQTWKQA==
X-Received: by 2002:a17:902:b58f:b0:1bc:48dc:d881 with SMTP id a15-20020a170902b58f00b001bc48dcd881mr11055741pls.8.1692045348416; Mon, 14 Aug 2023 13:35:48 -0700 (PDT)
Received: from ?IPV6:2600:380:4a56:1bb2:6d80:2b7e:8a4b:ba41? ([2600:380:4a56:1bb2:6d80:2b7e:8a4b:ba41]) by smtp.gmail.com with ESMTPSA id e9-20020a170902744900b001b7e63cfa19sm9885798plt.234.2023.08.14.13.35.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Aug 2023 13:35:47 -0700 (PDT)
Content-Type: multipart/alternative; boundary="------------yQo4L9hwSS97GXYyOctNzMf7"
Message-ID: <0b1d19e1-90b7-bc0e-853e-03f374daa54e@gmail.com>
Date: Mon, 14 Aug 2023 13:35:44 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0
Content-Language: en-US
To: Rahul Gupta <cxres@protonmail.com>, "dispatch@ietf.org" <dispatch@ietf.org>
References: <878ralz3o1.fsf@hobgoblin.ariadne.com> <c118cb08-08a7-10e5-9570-585f481ef4e8@gmail.com> <9J7fLcGYqf5jFd2d02LCQOprSpXUNVdCLGKMTkwGv2a-XWJyHe5YzB3ph01G4Pii4HFrNod5JxiqtjKwVu-Ydqeg80R_Dn1YSyz3LPnoOP4=@protonmail.com>
From: Michael Toomim <toomim@gmail.com>
In-Reply-To: <9J7fLcGYqf5jFd2d02LCQOprSpXUNVdCLGKMTkwGv2a-XWJyHe5YzB3ph01G4Pii4HFrNod5JxiqtjKwVu-Ydqeg80R_Dn1YSyz3LPnoOP4=@protonmail.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/dispatch/zFBQlx2AjQ-Chjw-2ybOkbLyB1E>
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 20:35:53 -0000

On 8/14/23 3:45 AM, Rahul Gupta wrote:
> Since mutations can differ for the type of resource, imho it is best to provide a negotiation mechanism instead. Which is what I do in PREP. Intermediaries can then handle mutations as they handle representations.

This might be hard to believe at first, but there actually exists a 
universal format that can express any mutation to any resource. We call 
this format the Range Patch 
<https://raw.githubusercontent.com/braid-org/braid-spec/master/draft-toomim-httpbis-range-patch-01.txt>, 
and it expresses any change as:

    "The range X specified in units Y was replaced with new contents Z."

The existence of this universal mutation format is a big deal, because 
it means a LOT less needs to be customized or specified for any 
particular application. All you need is a Range Unit 
<https://www.rfc-editor.org/rfc/rfc9110#name-range-units> that matches 
your resource's Content-Type.

Furthermore, Range Units are already things defined by HTTP, for Range 
Requests <https://www.rfc-editor.org/rfc/rfc9110#range.requests>. And 
now that HTTP supports Ranges inside of a PUT (called "Partial PUT 
<https://www.rfc-editor.org/rfc/rfc9110#name-partial-put>"), it has a 
built-in universal patch format.

That means that a universal patch format is already built into HTTP. 
This is enough to support all CRDT/OT operations in use today, and any 
other mutation I've run across.

All we need to do is specify the Range Units for our resources. Today, 
there's only a single range unit that's ever been standardized— the Byte 
Range <https://www.rfc-editor.org/rfc/rfc9110#name-byte-ranges>. We just 
need a standard JSON range, and one for whatever other content-type you 
care about — .PSD files, or whatever.

I suspect we can get into more of this in our upcoming call!

Michael