Closed emlun closed 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?
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.
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:
/peers
endoint returns an array of peer objects.baseurl
: Where this peer exposes its API. For example, ifbaseurl
ishttp://127.0.0.1:1234/datasucker
then this peer exposes card data athttp://127.0.0.1:1234/datasucker/cards
.accessible
: An object where the keys are ISO8601 timestamps (with timezone designator) and the values are booleans.true
means the peer was "okay" (for example, responded to a request) at that time,false
means the peer was "not okay" at that time. This object may have 0 or more keys.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: