TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Simple-graph – a graph database in SQLite

237 pointsby dpapathanasiouover 4 years ago

9 comments

rklaehnover 4 years ago
Interesting. SQLite is awesome.<p>I did something similar recently, a block store for a rust implementation of ipfs, which models a directed acyclic graph of content-addressed nodes.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;actyx&#x2F;ipfs-sqlite-block-store" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;actyx&#x2F;ipfs-sqlite-block-store</a><p>I found that performance is pretty decent if you do almost everything inside SQLite using WITH RECURSIVE.<p>The documentation has some really great examples for WITH RECURSIVE. <a href="https:&#x2F;&#x2F;sqlite.org&#x2F;lang_with.html" rel="nofollow">https:&#x2F;&#x2F;sqlite.org&#x2F;lang_with.html</a>
评论 #25546446 未加载
rekwahover 4 years ago
Tangentially related to graph dbs, but if you&#x27;re looking for more hierarchical support, SQLite does has a transitive closure extension[0] that might be of some assistance. I leveraged this back in 2014 to write our framework-agnostic result storage on AWS Device Farm.<p>[0] - <a href="https:&#x2F;&#x2F;www.sqlite.org&#x2F;cgi&#x2F;src&#x2F;artifact&#x2F;636024302cde41b2bf0c542f81c40c624cfb7012" rel="nofollow">https:&#x2F;&#x2F;www.sqlite.org&#x2F;cgi&#x2F;src&#x2F;artifact&#x2F;636024302cde41b2bf0c...</a><p>[1] - <a href="https:&#x2F;&#x2F;charlesleifer.com&#x2F;blog&#x2F;querying-tree-structures-in-sqlite-using-python-and-the-transitive-closure-extension&#x2F;" rel="nofollow">https:&#x2F;&#x2F;charlesleifer.com&#x2F;blog&#x2F;querying-tree-structures-in-s...</a>
评论 #25546243 未加载
kevasover 4 years ago
Why not add that functionality directly to SQLite via stored procs*<p><a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;Hierarchies-Smarties-Kaufmann-Management-Systems&#x2F;dp&#x2F;0123877334" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;Hierarchies-Smarties-Kaufmann-Managem...</a><p>*<a href="https:&#x2F;&#x2F;github.com&#x2F;wolfch&#x2F;sqlite-3.7.3.p1" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;wolfch&#x2F;sqlite-3.7.3.p1</a>
评论 #25545363 未加载
评论 #25545250 未加载
loxiasover 4 years ago
I really like this, OP. I&#x27;m member of the clan &quot;why are you creating your own XDR, just use sqlite!!&quot; and have oft jumped to that in technical discussions, so appreciate it.<p>However, what&#x27;s lacking from something like this is a detailed bill of the cost. I&#x27;d love to see some, <i>any</i> benchmark on a DB with &gt; 10^6 edges to see how it goes. That&#x27;s the other hand of the equation &quot;just use sqlite and be happy&quot; -- the expectation that performance will actually be reasonable.
ptrikover 4 years ago
Similar project: <a href="https:&#x2F;&#x2F;github.com&#x2F;CodyKochmann&#x2F;graphdb" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;CodyKochmann&#x2F;graphdb</a>
bjornsingover 4 years ago
How does this perform compared to a “native” graph database like Neo4J?
评论 #25545415 未加载
评论 #25545271 未加载
评论 #25545042 未加载
评论 #25545349 未加载
loliveover 4 years ago
I wonder if there are ways, in SQLite, to build indices for s,p,o&#x2F;s,p&#x2F;p,o&#x2F; and maybe more subtle ones... That would be uber nice, given the fact that most graph databases have their own indexing strategies, and you cannot craft your own.
评论 #25545593 未加载
评论 #25549412 未加载
roland_nilssonover 4 years ago
Isn&#x27;t the whole point of graph databases that they can traverse graph edges efficiently by following pointers to nodes, which relational databases can&#x27;t do? Then it seems a bit strange to implement a graph database on top of a relational database like SQLite?
评论 #25560501 未加载
brian_hermanover 4 years ago
Awesome! And you can write SQL queries on the data amazing SQLite is the best database.