Re: CBOR Tutorial

> it just doesn't supply an index
>
Which implies that it, by itself, does not support random access.

As I mentioned, you can build all sorts of infrastructure around it to allow it – but as an encoding format, it is not designed for that.

Leonard

From: "Brady com>" <duga@google.com>
Date: Thursday, February 1, 2018 at 8:20 PM
To: Leonard Rosenthol <lrosenth@adobe.com>
Cc: Romain <rdeltour@gmail.com>, Laurent Le Meur <laurent.lemeur@edrlab.org>, Baldur Bjarnason <baldur@rebus.foundation>, Ivan Herman <ivan@w3.org>, "Schindler Wolfgang Dr." <w.schindler@pons.de>, "Davis, Greg" <greg.davis@pearson.com>, Ric Wright <rkwright@geofx.com>, W3C Publishing Working Group <public-publ-wg@w3.org>
Subject: Re: CBOR Tutorial

Sorry, not an expert in CBOR, but it does seem like it allows random access, it just doesn't supply an index. But a client that wanted random access to the items in the package it could generate an index easily enough, either as a one-time pass over the complete package or during download. Granted, you may have to sequentially run through every byte in the data to generate that index due to indefinite strings and arrays, so might not be the fastest operation in the world, but again it is a one-time, fairly easy parse.

On Thu, Feb 1, 2018 at 2:22 AM, Leonard Rosenthol <lrosenth@adobe.com<mailto:lrosenth@adobe.com>> wrote:
So be careful to not confuse the data model (aka manifests, bundles etc.) and then encoding (CBOR in this case).

CBOR, by itself, does not support random access.

However, a data model (such as the WebPack work) that is then encoded into CBOR can provide support for random access (or at least a limited set of it, based on the model).

So yes if we were to adopt WebPack, we would achieve a level of random access.  (NOTE: if we do “object” compression, we may have to do some work on the manifest).

Leonard

From: Romain <rdeltour@gmail.com<mailto:rdeltour@gmail.com>>
Date: Thursday, February 1, 2018 at 2:18 PM
To: Leonard Rosenthol <lrosenth@adobe.com<mailto:lrosenth@adobe.com>>
Cc: Laurent Le Meur <laurent.lemeur@edrlab.org<mailto:laurent.lemeur@edrlab.org>>, Baldur Bjarnason <baldur@rebus.foundation>, Ivan Herman <ivan@w3.org<mailto:ivan@w3.org>>, "Schindler Wolfgang Dr." <w.schindler@pons.de<mailto:w.schindler@pons.de>>, "Davis, Greg" <greg.davis@pearson.com<mailto:greg.davis@pearson.com>>, Ric Wright <rkwright@geofx.com<mailto:rkwright@geofx.com>>, W3C Publishing Working Group <public-publ-wg@w3.org<mailto:public-publ-wg@w3.org>>
Subject: Re: CBOR Tutorial


On 31 Jan 2018, at 17:58, Leonard Rosenthol <lrosenth@adobe.com<mailto:lrosenth@adobe.com>> wrote:

CBOR is a great exchange format for “over the wire” data exchange.   It is not a good format for “off the web” exchange (IMO)


Primarily because its optimized for streaming and not random access.

Random access is always a better model for data processing but assumes that you have all the data already present (as would you “off the web”).  However, when streaming across a network/the web, you don’t always have the option (yes, there is byte range requests but they aren’t supported in all modern network configs, eg. load balancers).

My understanding is that random access depends on the actual data model being encoded in CBOR?

If I understand correctly, in the bundling spec, the index can be parsed first, and gives you pointers to each individual request/response pair, which effectively enables random access.
Random access is btw stated as an essential requirement for the packaging spec: https://tools.ietf.org/html/draft-yasskin-webpackage-use-cases-00#section-3.1.5<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftools.ietf.org%2Fhtml%2Fdraft-yasskin-webpackage-use-cases-00%23section-3.1.5&data=02%7C01%7Clrosenth%40adobe.com%7Cd327d8c0b59840ef04a908d56950983d%7C71f1da39c0a84d5a8d88a67b23c30bf4%7C0%7C0%7C636530717246387501&sdata=1NyJIIdxm%2FW0M8JbNVCixug9iLGWd7GgCT2G9LdOnuo%3D&reserved=0>

Am I missing something?

Romain.

Received on Thursday, 1 February 2018 19:46:13 UTC