4 A: Plain text only, preferably S-expressions, maybe canonical (stricty spoken being binary).
6 Reason: Foster simplicity in long-term storage. We shall need all kinds of formats, like atom/RFC4287, webfinger/RFC7033, activitypub. Some are xml based, some json.
8 So we have all kinds of ugly formats that we have to write and in some cases read. But the only source of truth is exclusively S-expressions.
12 - human readable storage
15 - map well to Atom RFC 4287
16 - map well to https://www.w3.org/TR/activitystreams-vocabulary/#dfn-note
17 - cheap append, no modify, expensive delete (re-group entries), no tombstones (leave no trace)
18 - scale to 100k posts, 10k followers
19 - make undesired state unrepresentable
20 - human usable, terse ids, e.g. minute since epoch in human base32 or https://opam.ocaml.org/packages/base32
25 - default page size is 50
26 - most recent page has no, 2nd the highest number, oldest is page zero
27 - most recent has 50 posts, 2nd has 1-49, older 50 each
28 - on post deletion that page and all more recent ones have to be rewritten, archives, too
29 - modifying a post creates a new one with reference to the ancestor, deletion optional
30 - there may be additional archive chunks with a size of 5k (100k posts = 20 archive chunks)
31 - each page has a cdb each for url->id and id->pos
32 - there is no global id or url lookup (ask each page/archive instead)
33 - there is a global counter however for tags
34 - the same page/archive apply for tags (/o/t/<tagname>/) and days (/o/d/<dayrfc3339>/)
35 - urls ARE unique as changes delete the old post (thus ids 404)
36 - ids have a total order
42 - updated date mandatory
43 - published date optional
44 - title mandatory, language optional
45 - text content (incl. language) optional
46 - enclosure (=attachment) optional
47 - additional titles and content (one per language)?
48 - a Link https://www.w3.org/TR/activitystreams-vocabulary/#dfn-link or Note https://www.w3.org/TR/activitystreams-vocabulary/#dfn-note
49 - 'acvitity/note' (=create), reply, 'announce' (=boost), like, dislike,
53 - create+note (add,reply)
55 - announce+link (boost) = reply without content
58 ## Actions on other actors
60 - Block https://www.w3.org/TR/activitystreams-vocabulary/#dfn-block
61 - Undo Block https://www.w3.org/TR/activitystreams-vocabulary/#dfn-undo
65 - write single post to a single file,
66 - add global store length to index file (evtl. cdb uri->pos), append post to global store,
67 - if 2nd-most recent page has 50 entries, start a new, empty one
68 - move oldest single post to 2nd-most recent page
69 - add a marker char to a page.cnt file
70 - refresh dependant atom & activitypub