Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple/alternative data retrieval implemenations #98

Open
achingbrain opened this issue Apr 18, 2023 · 1 comment
Open

Multiple/alternative data retrieval implemenations #98

achingbrain opened this issue Apr 18, 2023 · 1 comment
Labels
kind/architecture Core architecture of project kind/discussion Topical discussion; usually not changes to codebase

Comments

@achingbrain
Copy link
Member

Currently Helia takes a blockstore that it enhances with bitswap. This creates a hard dependency on bitswap.

To enable experimentation and adoption of faster/more use-case specific retrieval protocols (cars, graphsync, XYZNewFutureProtocol etc) we should allow this to be a configuration option.

At this point blocks may not be the correct abstraction since it limits us to a block as the unit of data you get in response to a CID.

A better read abstraction might be a CID to a stream of Uint8Arrays? The the underlying retrieval method can apply whatever optimisations it can to fetch the data quickly and the calling code doesn't have to keep going back to fetch another block for another CID.

interface Options {
  offset?: number
  length?: number
}

interface ContentReader {
  get (cid: CID, options: Options): AsyncGenerator<Uint8Array>
}

Questions:

  • Does this shift complexity of interpreting block data on to the content reader?
  • What does the writer interface look like?
    • Can the writer/reader interfaces be asymmetric? E.g. CIDs/Blocks in, CID/Stream out?
  • Does this assume file data?
  • What about structures like unixfs where the root block has file metadata and then file data in leaf nodes?
  • If DAGs are all dag-pb, dag-cbor or dag-json we can make some assumptions about structure?
@achingbrain achingbrain added kind/architecture Core architecture of project kind/discussion Topical discussion; usually not changes to codebase labels Apr 18, 2023
@SgtPooki
Copy link
Member

@achingbrain Can we call this done since we completed the implementation of the BlockBroker interfaces?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/architecture Core architecture of project kind/discussion Topical discussion; usually not changes to codebase
Projects
No open projects
Development

No branches or pull requests

2 participants