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

PubSub/Feeds #13

Open
parkan opened this issue Sep 16, 2016 · 12 comments
Open

PubSub/Feeds #13

parkan opened this issue Sep 16, 2016 · 12 comments
Assignees

Comments

@parkan
Copy link
Contributor

parkan commented Sep 16, 2016

Using flooding for now

@whyrusleeping mentioned that some pubsub support was shipped in libp2p?

@parkan parkan modified the milestone: v1 Sep 16, 2016
@vyzo
Copy link
Contributor

vyzo commented Sep 16, 2016

No flooding needed, and we have persistence requirements. Plus it's really straightforward to implement the network parts with libp2p streams, we don't need anything special.

Overall approach:

  • Feeds are advertised to the directory
  • Feeds are subscribed by directly connecting to the peer, syncing and keeping a stream open for updates
  • The synchronization happens with per peer timestamp, ntp is a reasonable dependency. It takes a simple query for messages by publisher id and timestamp > last peer sync time.
  • When the publisher disconnects, the subscribers will keep polling with exponential backoff by looking up the peer in the directory.

@vyzo
Copy link
Contributor

vyzo commented Sep 29, 2016

I think we want to limit the scope on this, as it is a big topic and not quite necessary for v1.

What we need instead for v1 is the query protocol (#22 ) and merging of remote data sets (#25 ).
Couple this with published namespace announcements and we already have a usable system without the complexities of pubsub.

@vyzo vyzo modified the milestones: V2, v1 Sep 29, 2016
@vyzo
Copy link
Contributor

vyzo commented Oct 14, 2016

I think we should implement it totally in RSS way, with polling and merging.
There is no urgency for push publishing until we have real-time feeds to distribute.

@parkan
Copy link
Contributor Author

parkan commented Oct 14, 2016

That's fine by me. I think the most lightweight implementation is best right now, and poll + merge (or just merge on demand, really) is that

@parkan parkan added this to the 12/5 Sprint (v1.3) milestone Nov 8, 2016
@denisnazarov
Copy link
Contributor

denisnazarov commented Nov 29, 2016

Implementation suggested by Matthew Roberts on top of kad: https://github.com/kadtools/kad-quasar (paper)

Apparently storj uses it in production, described in this vid.

@parkan:

we'd need to port it to https://github.com/libp2p/js-libp2p-kad-routing

@denisnazarov
Copy link
Contributor

Another thought... The nice thing about https://github.com/libp2p/go-floodsub is that it establishes the interface, so higher-level development can proceed with assumption the underlying implementation will be come performant at some point w/o worrying about details.

We can do something similar with polling..

@parkan
Copy link
Contributor Author

parkan commented Nov 30, 2016

@denisnazarov not sure the iface would be the same for non-flooding impl

@denisnazarov
Copy link
Contributor

@parkan wanted to revisit this, since we've made lots of progress on mediachain foundations since opening this issue.

after speaking to @haadcode earleir, he suggested it would be fairly trivial to implement pubsub features from orbit-db to notification features to our namespaces.

goal is to implement this as a prototype to showcase the potential of the tech (not meant to be production grade), as well as to bridge our communities and show how mediachain and orbit-db/ipfs are collaborating, and that the sum of the technologies is something really cool

ideal demo would be something like a "decentralized instagram" where two people publish to the dinstagram.* and see their data update in real time.

also down to consider an api that uses polling under the hood and could be switched out for more robust pubsub in the future?

@parkan
Copy link
Contributor Author

parkan commented Jan 12, 2017

EDIT: mangled this during a stale edit, see below

@haadcode
Copy link

haadcode commented Jan 13, 2017 via email

@parkan
Copy link
Contributor Author

parkan commented Jan 13, 2017

Ooops apparently I left these unposted somehow yesterday? @haadcode addressed this somewhat already so posting as a separate comment for the record

Basically participating nodes can instantiate a corresponding orbit-db-eventstore and ping it for each statement written to the corresponding namespace.

Unclear things:

  • linearization (sounds like there's a deterministic join semilattice)
  • connectedness/scaling: it seems like currently floodsub keeps complete (?) peer and topic lists on all nodes so there's (n/k)((n/k)-1)/2 edges, is that correct? at what point is this expected to fall over?
  • channel creation/control/permissions: what does orbitdb.eventlog(foo.bar) actually do? I am guessing at this point anyone is allowed to write to anywhere and this just creates an entry in the topics map -- sounds like this is the biggest integration point

@parkan
Copy link
Contributor Author

parkan commented Jan 13, 2017

@haadcode thanks for chiming in, looking forward to exploring this together! No rush, let us know when you have a chance for a more in-depth technical discussion.

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

4 participants