Live data from Hacker News

Show HN: LatticeDB – Like SQLite but for graph databases

github.com

41–50 of 53 posts

Re: Show HN: LatticeDB – Like SQLite but for graph databases

#41
post #23

I'm a big fan of SQLite embedded nature, which allows for chaining multiple SQL calls with near-zero latency. I'm currently building a personal knowledge graph server a mix of Notion's custom entities via JSON schema and Obsidian markdown+backlinked references. It's working well, but I suspect your product might be a better fit. I do have one question regarding permissions: how would you recommend modeling a hierarch…

Modern authorization systems are often graph-based. Check out ReBAC and ABAC authorization models and also implementations like apache/casbin or authzed/spicedb. These schemas often have surprisingly simple graph definitions; I bet they could be replicated in LatticeDB without much trouble.

Re: Show HN: LatticeDB – Like SQLite but for graph databases

#42
I measured this on a M4 mac mini (base model):

  zig build sqlite-benchmark

  Medium (100K nodes)

  +----------------------+-----------+---------+---------+
  | Workload             | LatticeDB | SQLite  | Speedup |
  +----------------------+-----------+---------+---------+
  | 1-hop traversal      | 5.7μs     | 16.1μs  | 2.8x    |
  | 2-hop traversal      | 30.1μs    | 59.4μs  | 2.0x    |
  | 3-hop traversal      | 171.1μs   | 228.8μs | 1.3x    |
  | Variable path (1..5) | 82.2μs    | 5.8ms   | 70.4x   |
  +----------------------+-----------+---------+---------+
Very different from the comparison on github and the website.

Given that on-disk data structures are similar to SQLite, I expect the competition from other "graph on sqlite" projects when they co-opt the techniques in LatticeDB.

Re: Show HN: LatticeDB – Like SQLite but for graph databases

#43
Very nice - been looking for something that combined the flexibility of graph DBs like Neo4j with the simplicity and low cognitive overhead of SQLite. PErformance looks great too.

Excellent Readme - as well as the clear explanations and examples, very impressed by the 'when you should use it/when you should NOT' use it' section - sadly often missing on many worthy but unfriendly tools.

Re: Show HN: LatticeDB – Like SQLite but for graph databases

#44
post #20

Does it have something like litestream to backit up for specific production usecases (i.e. a single webserver is enough and downtime of a few mins is tolerable)?

I am in the final stages of adding this based on your comment. Just wrapping up doc updates and will push a new release with hot copy functionality tonight!

champion

Re: Show HN: LatticeDB – Like SQLite but for graph databases

#46
post #15

I wonder about mapping RDF data (like Wikidata) to this. I guess the RDF predicate becomes the edge in your node-edge style of graph.

Yes! This is something I've been thinking about quite a bit the past few weeks. We are going in this direction at work and I think graph storage is a natural way to think about this.

Interesting, I used to work quite a lot with triples from ontologies.

Since the release of LLMs, do you still see use cases for ontologies and triples (RDF, OWL or otherwise) compared to simply feeding it to an LLM?

Re: Show HN: LatticeDB – Like SQLite but for graph databases

#47
post #27

Earlier quoted context omitted.

Yes! This is something I've been thinking about quite a bit the past few weeks. We are going in this direction at work and I think graph storage is a natural way to think about this.

If you're going to support RDF, please also consider supporting SPARQL for querying the data.

For my own edification, what is the goal of SPARQL compared to normal SQL or if you live in predicate-land, Prolog or Datalog?

The semantic web tools never seemed to have their breakout moment and seem to run in parallel to "mainstream" history of relational and logic programming, but I've never really understood why.

Re: Show HN: LatticeDB – Like SQLite but for graph databases

#49

I measured this on a M4 mac mini (base model): zig build sqlite-benchmark Medium (100K nodes) +----------------------+-----------+---------+---------+ | Workload | LatticeDB | SQLite | Speedup | +----------------------+-----------+---------+---------+ | 1-hop traversal | 5.7μs | 16.1μs | 2.8x | | 2-hop traversal | 30.1μs | 59.4μs | 2.0x | | 3-hop traversal | 171.1μs | 228.8μs | 1.3x | | Variable path (1..5) | 82.2μs…

Thanks for sharing this. The lattice numbers are pretty close but my sqlite numbers are way off. I got a new computer since then so will remeasure.

Re: Show HN: LatticeDB – Like SQLite but for graph databases

#50

Very nice - been looking for something that combined the flexibility of graph DBs like Neo4j with the simplicity and low cognitive overhead of SQLite. PErformance looks great too. Excellent Readme - as well as the clear explanations and examples, very impressed by the 'when you should use it/when you should NOT' use it' section - sadly often missing on many worthy but unfriendly tools.

Thanks - appreciate the feedback! I wanted the README to be something you could quickly glance at, get a sense of the project and whether it's what you are looking for, and be done with it.
Post reply on HN