Minimal Sbot
Working on %epidemic-broadcast-trees has made me think about the minimal sbot again. This will enable websbot and improve the situation on mobile, etc too.
Running on as lightweight devices as possible is a long term goal for me.
So, to support a basic user interface like patchbay, we need
db.get(msgId, cb)
db.read() => Source //query the local database log, forward, reverse, live, etc
db.backlinks(msgId, cb) //get messages which mention this message (such as replies, digs)
db.getBySeq([feedId, seq], cb) //get the message in this feed with a particular sequence (needed for replication)
db.latestSequence(cb) //get the latest known sequence for every feed. (needed for replication)
db.append(msg, cb) //append this message
I think that is the actually all we need for the database. you can get a thread, digs, etc using backlinks, to build notifications you just scan the main log backwards, and filter for relavant messages.
Indexes required:
key: msgId -> log offset
backlink: msgId -> [log offsets of linking msgs...]
sequence: [feedId, seq] => log offset
The index for the latest sequence can just be a %flumeview-reduce an in memory table that is occasionaly persisted.
If a view is a relation between feeds (follows, names, avatars) then that can become a %flumeview-reduce and if it's just about messages, then it can become backlinks.