asami

Asami, the graph database https://github.com/threatgrid/asami
quoll 2021-02-08T23:43:17.001600Z

I’m going offline for a week. Before I left I wanted to provide some descriptions of the structure of Asami, and some historical context of the architectural choices. I’m not done yet, but you can find links to the posts on the https://github.com/threatgrid/asami/wiki/History-of-Asami.

👍 1
2021-02-10T17:29:15.003400Z

This looks great… thanks! I think I noticed a small typo in the first post that confused me: https://dev.to/quoll/asami-7ll > It turns out that these 3 orderings allow someone to find all matching statements for any given group of subject, predicate, and object. Interestingly, the remaining 3 possible orderings also permit this. Shouldn’t that be “these 6 orderings”? 3 would imply there are no remaining 3. again many thanks 🙇

quoll 2021-02-10T23:55:09.006600Z

I just read this and it says what I meant to say. I tweaked the sentence a little, in case that might help.

quoll 2021-02-10T23:56:10.007800Z

- Subject, Predicate, Object - Predicate, Object, Subject - Object, Subject Predicate There are 6 possible orderings (calculated as 3! or 3 factorial). It turns out that the 3 orderings shown here allow someone to find all matching statements for any given group of subject, predicate, and object. Interestingly, the remaining 3 possible orderings also permit this. The two groups of orderings are distinct, in that any group that tried to contain ordering from more than one group would need more than 3 indices to be able to fulfill every possible query.

quoll 2021-02-11T00:00:05.011800Z

Not shown in the post are the other 3: - object,predicate,subject - predicate,subject,object - subject,object,predicate

quoll 2021-02-11T00:01:12.013300Z

Those would also work. They’re a complement to the other set

2021-02-11T00:03:35.013500Z

ok that reads better thanks. I think I understood what you were saying, as I read a paper on this subject a few years back. Essentially you don’t need full coverage of all index permutations, as the two groups are ultimately equivalent.

quoll 2021-02-11T00:04:43.013800Z

Yes

quoll 2021-02-11T00:05:53.015600Z

But when you get to 4 values, you have 4 groups that are equivalent, and each group is 6 in size

2021-02-11T00:06:22.015800Z

:thumbsup:

2021-02-11T00:06:25.016Z

I didn’t mean to drag you back online though! Sorry about that 🙂

quoll 2021-02-11T00:07:33.017900Z

Fortunately, a few of the indexes are almost never used, since each value has a different use. So Asami doesn’t use all 6

quoll 2021-02-11T00:07:40.018200Z

Just 4

quoll 2021-02-11T00:08:09.019100Z

And the 4th one isn’t a tree index, which helps

quoll 2021-02-11T00:08:55.020400Z

But I’ll get to that (I haven’t written it yet, though the code has been built)

Steven Deobald 2021-02-08T23:47:36.001900Z

@quoll This is very cool! Thanks for taking the time to write it up. 🙂

quoll 2021-02-08T23:47:51.002100Z

You’re welcome 🙂

quoll 2021-02-08T23:48:03.002400Z

More writing to be done, and I still need to get the first release of storage out

quoll 2021-02-08T23:48:37.003100Z

But I thought that this would put me in a good place to leave it for a short while