ssbc / ssb-db2

A new database for secure-scuttlebutt
47 stars 8 forks source link

Lite friends #5

Closed arj03 closed 3 years ago

arj03 commented 3 years ago
arj03 commented 3 years ago

@staltz notes for tomorrow

Data points:

arj03 commented 3 years ago

I consider contacts quite fundamental to SSB which is why I'm thinking of putting it in core. The overhead if quite minimal. I was looking over ssb-friends and if you rip out the db part, it is mostly convenience methods. So could live in its module and just use db2 as the storage.

arj03 commented 3 years ago

Also by doing it this way we don't need to keep very much in memory which I think existing friends does. This should be especially good for startup time.

staltz commented 3 years ago

ssb-friends has two layered reduces: one reduce for "is A following B?" over all contact messages that A created, and another reduce that depends on the previous one: "at what hops distance is C from A?"

staltz commented 3 years ago
mixmix commented 3 years ago

I thought with Dijkstra that it has a graph and the you can ask it about any start point with that I have only seen one call to createLayer? Do you mean there are two reduces inside layered graph?

arj03 commented 3 years ago

We probably want to start with dynamic-dijkstra and just remove the layered graph stuff. As always things like this makes me uneasy.

arj03 commented 3 years ago

It turns out my test script for jitdb had quite a bit of overhead, so now its between 40ms for small profiles (staltz phone) to 100ms for mix. In comparison base index is 15ms and 58ms. Also my earlier observation about adding select style queries instead of just returning the whole message still holds. It is not faster.

arj03 commented 3 years ago

This task turned into a friends PR. Currently the index format is too slow, but I'm quite sure it will work with dictionary compression. Will try that today.

arj03 commented 3 years ago

Now that the db2 compatibility is merged into ssb-friends I'll close this