Live data from Hacker News

Show HN: LatticeDB – Like SQLite but for graph databases

github.com

31–40 of 54 posts

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

#31
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…

The permissions question is interesting. I think the answer depends on context. One approach would be to create some edge types `hasAccessTo` and `accessibleBy` that connect a user to a node. Then I'd create an edge type `childOf`. The rest is business logic. Permission checks can just traverse up to the first root node with permissions. The downside is this is all business logic, so can't really look at the database and understand this is how it works. Depending on the database you could create a function that returns permissions for any node, that encapsulates this logic.

Anyways, thanks for checking it out! Really appreciate it. Good luck with your project!

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

#32

Nice work. How do you handle concurrent writers on a single file? That's where embedded databases usually get tricky, and the graph model makes locking even more interesting.

Within the same process it's enforced at the db level. After reviewing the code more I see we don't have a mechanism in place to manage safety across processes. Will add a file lock mechanism tonight. Great call out!

In general though, the goal for this was single writer multiple readers. That was a design decision to keep things simple.

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

#33
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!

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

#34
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.

I started thinking more deeply about how I would actually do this today and it won't be as straight forward as I initially thought. Will keep it on the radar and see if I can figure out a clean way to implement. Great suggestions!

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

#35

See also: https://ladybugdb.com/ "DuckDB for graphs"

...turns out they are compared here: https://docs.latticedb.org/comparisons/vs-kuzu

Congrats!

For those into the `pip install ...` flow and kuzu, is gfql: we started around the same time in a non-VC-funded oss manner with overlap in key architectural ideas:

- cpu columnar vectorized engine + optionally the only open source gpu engine mode for bigger graphs / faster queries

- removes the need for a database / file: pure compute-tier engine you can write to parquet/json if you want, plays with parallel reader/writers in simple ways b/c that, and TBD iceberg

- adds full graph analytic pipeline support, eg, for feature engineering in real-time fraud & memory pipelines

- also millisecond/submillisecond times on small graphs like that small 100K edge graph benchmark

Main box not formally checked is streaming. Funny enough, we're designed for GPU firehose workloads, so would be fun to demo and see what gaps are left.

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

#38
post #26

Nice, I’ll get it added to gdb-engines.com

Thanks, that's a great list! Might be worth mentioning our engine there too, for people who want a graph database atop SQLite and other battle-tested relational databases like MySQL, MariaDB, Postgres.

My team and I built it over the years, and it's open source (AGPL). Here is how it works: https://community.qbix.com/t/qbix-streams-as-a-graph-databas...

Our database abstraction layer (and optional ORM) has been battle tested in production for millions of users, and has 3 adapters: Sqlite, Postgres, MySQL/MariaDB. And recently it even added vector search for ranking results by similarity: https://github.com/Qbix/Platform/tree/main/platform/classes/...

Documentation for the database layer is here: https://qbix.com/platform/guide/database

PS: If you do use a relational database for storing graph data, you're going to have a lot of duplication in some public keys. I highly recommend putting ZFS underneath, to help with deduplication. ZFS uses zstd, developed at facebook, and also can encrypt your data at rest (don't use the relational database to do the encryption, otherwise deduplication doesn't work).

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

#39

See also: https://ladybugdb.com/ "DuckDB for graphs"

...turns out they are compared here: https://docs.latticedb.org/comparisons/vs-kuzu

LadybugDB maintainer here.

Couple of corrections:

* LadybugDB has revamped the Kuzu WAL design. It shouldn't be hard to build WAL based replication

* 19ms vs 39us - like the author says these are vastly different systems and the benchmark methodology may not be comparable.

We've mostly focused on query plan optimizations, not so much the micro query operator optimizations.

The 0.20.x end of the month release should have some interesting optimizations.

  * Prepared statements will cache query plans and result vectors. So you don't pay malloc costs
  * SIMD optimizations for filter. More to come in the next release.

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

#40
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.

Wikidata doesn't imply RDF/SPARQL. Cypher works fine too. A columnar storage engine means you get indexes and the relational goodness for free.

https://huggingface.co/datasets/ladybugdb/wikidata-20260401

Post reply on HN