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

Discussion: Full streaming in Hyperdrive. #51

Open
martinheidegger opened this issue Nov 30, 2018 · 1 comment
Open

Discussion: Full streaming in Hyperdrive. #51

martinheidegger opened this issue Nov 30, 2018 · 1 comment

Comments

@martinheidegger
Copy link
Contributor

Using Hyperdrive: when creating a write-stream in DAT, the logic will create a new version of a file for every chunk added. This allows to implement a distributed read-stream but following questions occur:

  • How much data is going to be written to the stream? (Some streams - such as uploading a big zip file - can predict how much data will be part of the stream)
  • Is it worth to keep the versions between the start of the stream and the end of the stream? (does metadata need to be sent for every block?)
  • When is the write stream finished?
  • What happens when a write stream is corrupted?

Currently the reading of streams is implemented by looking at the stat, and as soon as all the data for the stream arrived the stream is finished hyperdrive/index.js#L510

While the writing of streams appends a lot of data to the content-log hyperdrive/index.js#L578,
it adds only one statement to the tree after finish hyperdrive/index.js#L598.

This means (to my understanding) that currently hyperdrive only starts a read-stream on a peer after a write-stream on the creators machine has entirely finished.

My straightforward idea to fix this would be that upon creation of a write-stream, hyperdrive could add a put message immediately to it: stating the streams final size if know or 0; adding a "open"-flag to the Stats. Upon finish there would be another tree.put with the final stats that don't contain the "open"-flag.

@martinheidegger martinheidegger changed the title Discussion: Temporary versions / streams Discussion: Full streaming in Hyperdrive. Nov 30, 2018
@Frando
Copy link

Frando commented Dec 4, 2018

I coded something up recently: jimpick/hyperdrive#1
The PR adds an option to hyperdrive to write the stat after each flush. It allowed me to view a video on a peer while still importing it on the source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants