Show More
@@ -1,34 +1,44 b'' | |||||
1 | # INTRO # |
|
1 | # INTRO # | |
2 |
|
||||
3 | This document discribes the server sync protocol. |
|
2 | This document discribes the server sync protocol. | |
4 |
|
3 | |||
|
4 | # PURPOSE # | |||
|
5 | This protocol will be used to share the models (currently imageboard posts) | |||
|
6 | across multiple servers. The main differnce of this protocol is that the node | |||
|
7 | can specify what models it wants to get and from whom. The nodes can get | |||
|
8 | models from a specific server, or from all except some specific servers. Also | |||
|
9 | the models can be filtered by timestamps or tags. | |||
|
10 | ||||
5 | # DRAFT PROTOCOL DESCRIPTION # |
|
11 | # DRAFT PROTOCOL DESCRIPTION # | |
6 |
|
||||
7 | The node requests other node's changes list since some time (since epoch if |
|
12 | The node requests other node's changes list since some time (since epoch if | |
8 | this is the start). The other node sends a list of post ids or posts in the |
|
13 | this is the start). The other node sends a list of post ids or posts in the | |
9 | XML or JSON format. |
|
14 | XML or JSON format. | |
10 |
|
15 | |||
11 | Protocol version is the version of the sync api. Model version is the version |
|
16 | Protocol version is the version of the sync api. Model version is the version | |
12 | of data models. If at least one of them is different, the sync cannot be |
|
17 | of data models. If at least one of them is different, the sync cannot be | |
13 | performed. |
|
18 | performed. | |
14 |
|
19 | |||
15 | The node signs the data with its key. The receiving node saves the key at the |
|
20 | The node signs the data with its key. The receiving node saves the key at the | |
16 | first sync and checks it every time. If the key has changed, the info won't be |
|
21 | first sync and checks it every time. If the key has changed, the info won't be | |
17 | saved from the node (or the node id must be changed). |
|
22 | saved from the node (or the node id must be changed). | |
18 |
|
23 | |||
19 | Each node holds a list of networks it wants to get info from. |
|
24 | Each node can have several keys. Nodes can have shared keys to serve as a pool | |
|
25 | (several nodes with the same key). | |||
20 |
|
26 | |||
21 | Each post has an ID in the unique format: node-id/post-id |
|
27 | Each post has an ID in the unique format: node-id/post-id | |
22 |
|
28 | |||
23 | All requests pass a request type, protocol and model versions and a list of |
|
29 | All requests pass a request type, protocol and model versions and a list of | |
24 | optional arguments used for filtering. |
|
30 | optional arguments used for filtering. | |
25 |
|
31 | |||
26 | # REQUESTS # |
|
32 | # REQUESTS # | |
27 | Request types: |
|
33 | Request types: | |
28 | * pull - pull the desired model ids |
|
34 | * pull - pull the desired model ids | |
29 | * get - get models by ids |
|
35 | * get - get models by ids | |
|
36 | * put - give a model to the given node (you have no guarantee the node takes | |||
|
37 | it, consider you are just advising the node to take your post. This request | |||
|
38 | type is useful in pool where all the nodes try to duplicate all of their data | |||
|
39 | across the pool. | |||
30 |
|
40 | |||
31 | # RESPONSES # |
|
41 | # RESPONSES # | |
32 | * not supported - request is not supported |
|
42 | * not supported - request is not supported | |
33 | * success - request was successfull |
|
43 | * success - request was successfull | |
34 | * error - unexpected error |
|
44 | * error - unexpected error |
General Comments 0
You need to be logged in to leave comments.
Login now