datasucker / netrunner-datasucker

MIT License
20 stars 7 forks source link

Share peers? #3

Closed emlun closed 9 years ago

emlun commented 9 years ago

Might it be a good idea to have datasuckers share peers with each other, as a way to keep a decentralized list of network members? I imagine the API could look something like this:

A datasucker could use this information to maintain a somewhat recent list of other online datasuckers available for syncing with. The timestamp information could be used to judge whether a peer is dead, but that decision would ultimately be up to each datasucker to make. If a datasucker isn't interested in participating in sharing peers, it could simply always return an empty array without breaking interaction with other datasuckers.

While this API provides no method for discovering new peers, it will make it possible for a user to inject a peer into their datasucker and have it propagate to other datasuckers as well.

One could perhaps also accept PUT requests to /peers, with a request body on a similar format as, a way for datasuckers to "push" peers to each other. In this way, a newly started datasucker would only need to find one other datasucker and push itself to that in order to make itself known to the network. The particulars of a push protocol might need a little more thought put into it.

Example response:

/peers

---
[
    {
        "baseurl": "http://127.0.0.1:1234/datasucker",
        "accessible": {
            "2014-10-06T13:33:37+03:00": true,
            "2014-10-07T00:00:42.4935-04:00": false,
            "2014-10-02Z": true,
        }
    }
]
emlun commented 9 years ago

An argument I can see against this is that it would counteract the

The servers hosting this data will be private and not easily discoverable.

part. Thoughts on this?

datasucker commented 9 years ago

The argument of privacy is correct here. If one data sucker is discovered, currently they don't compromise the entire network, and ideally we keep it that way.