##// END OF EJS Templates
Clarified the sync document
Clarified the sync document

File last commit:

r839:b2941d7f decentral
r839:b2941d7f decentral
Show More
sync.markdown
59 lines | 2.6 KiB | text/x-markdown | MarkdownLexer
neko259
Starting a new branch. Added protocol description
r758 # INTRO #
This document discribes the server sync protocol.
neko259
Updated the sync protocol doc
r784 # PURPOSE #
This protocol will be used to share the models (currently imageboard posts)
across multiple servers. The main differnce of this protocol is that the node
can specify what models it wants to get and from whom. The nodes can get
models from a specific server, or from all except some specific servers. Also
the models can be filtered by timestamps or tags.
neko259
Starting a new branch. Added protocol description
r758 # DRAFT PROTOCOL DESCRIPTION #
The node requests other node's changes list since some time (since epoch if
this is the start). The other node sends a list of post ids or posts in the
XML or JSON format.
Protocol version is the version of the sync api. Model version is the version
of data models. If at least one of them is different, the sync cannot be
performed.
neko259
Clarified the sync document
r839 The node signs the data with its keys. The receiving node saves the key at the
neko259
Starting a new branch. Added protocol description
r758 first sync and checks it every time. If the key has changed, the info won't be
neko259
Clarified the sync document
r839 saved from the node (or the node id must be changed). A model can be signed
with several keys but at least one of them must be the same as in the global
ID to verify the sender.
neko259
Some additional info to the sync doc
r759
neko259
Updated the sync protocol doc
r784 Each node can have several keys. Nodes can have shared keys to serve as a pool
(several nodes with the same key).
neko259
Some additional info to the sync doc
r759
neko259
Clarified the sync document
r839 Each post has an ID in the unique format: [key-type][key][local-id]
neko259
Changed protocol a bit to be more clear and universal
r778
neko259
Clarified the sync document
r839 All requests pass a request type, protocol and model versions, and a list of
neko259
Changed protocol a bit to be more clear and universal
r778 optional arguments used for filtering.
neko259
Clarified the sync document
r839 Each request has its own version. Version consists of 2 numbers: first is
neko259
Edited info about version
r786 incompatible version (1.3 and 2.0 are not compatible and must not be in sync)
and the second one is minor and compatible (for example, new optional field
is added which will be igroned by those who don't support it yet).
neko259
Moved signatures block to the model block. All the signed content is in the 'content' block now. Removed edit time, previous and next posts links from the XML sync output because they can be computed from the post itself and can be changed locally for foreign posts (which breaks the signature)
r838 Post edits and reflinks are not saved to the sync model. The replied post ID
can be got from the post text, and reflinks can be computed when loading
posts. The edit time is not saved because a foreign post can be 'edited' (new
replies are added) but the signature must not change (so we can't update the
content). The inner posts can be edited, and the signature will change then
but the local-id won't, so the other node can detect that and replace the post
instead of adding a new one.
neko259
Changed protocol a bit to be more clear and universal
r778 # REQUESTS #
Request types:
* pull - pull the desired model ids
* get - get models by ids
neko259
Updated the sync protocol doc
r784 * put - give a model to the given node (you have no guarantee the node takes
it, consider you are just advising the node to take your post. This request
type is useful in pool where all the nodes try to duplicate all of their data
across the pool.
neko259
Updated the pull response to be more clear and short
r782
# RESPONSES #
* not supported - request is not supported
* success - request was successfull
* error - unexpected error