ipfs / specs

Technical specifications for the IPFS protocol stack
https://specs.ipfs.tech
1.15k stars 232 forks source link

gateway: batching raw block requests (AKA userland traversal of DAGs with unknown codecs) #427

Open lidel opened 11 months ago

lidel commented 11 months ago

Performance gap in trustless retrieval

Something we've identified during user research is the ability to fetch arbitrary raw blocks in a single request.

This comes up in two use cases:

In both cases the DAG is not traversable on the backend, but the client still is able to retrieve it block by block: reading the root, then learning about child branches, and requesting each of them as application/vnd.ipld.raw.

The downside is the number of unnecessary roundtrips when multiple CIDs could be requested at the same time.

We want to remove the gateway as an innovation choke point and improve performance for in use cases where content-addressable data can't be traversed by the gateway, but can still be retrieved block-by-block.

The need

Specification should include a canonical way for batching multiple application/vnd.ipld.raw in a single request.: asking trustless gateway for N CIDs, and getting related blocks back without spending resources on multiple requests.

It could be a new request-response type, or a clarification around multiplexing present in HTTP/2 and HTTP/3.

TODO