You are reading content from Scuttlebutt
@Dominic %di/8i95Kx8pMLR8S2PrIQYiYaIHKo/n/DgmJB5vlM5s=.sha256

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.

@cryptix %HxYNDkWAbv2AupvNehQaKbsGDps+NyLapRVdkpvOIrY=.sha256

very much in favor of this!

not sure if you meant this with

This will enable websbot and improve the situation on mobile, etc too.

but finding a quasi-final point for this interface (trying to ditch the word standardt) would also make it more interesting to work on alternate sbot implementations that could feed the same UI.

taking the flume(view)-rewrite asside (since flume might remove the need for them), would the current ssb-plugins (like -query and -links2) be fine with this api? meaning could they work on top of it or do some need closer/direct access to the indexdb? might be a good hook to see how good the design is...

@Dominic %hd8cPqo3sV66qwWJBC5ubN4nuMSjvJ+hCqvxicjQ6gU=.sha256

finding a quasi-final point for this interface (trying to ditch the word standardt) would also make it more interesting to work on alternate sbot implementations that could feed the same UI.

great point!

Yes, query/links are just based on streaming from the log, so all they need are read and get.

Join Scuttlebutt now