TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: SirixDB – Bitemporal binary JSON database system and event store

109 点作者 lichtenberger超过 1 年前
I had already posted the project a couple of years ago, and it gained some interest, but a lot of stuff has been done since then, especially regarding performance, a completely new JSON store, a REST API, various internals refactored, an improved JSONiq based query engine allowing updates, implementing set-oriented join optimizations, a now already dated web UI, a new Kotlin based CLI, a Python and TypeScript client to ease the use of Sirix... First prototypes from a precursor stem already from 2005.<p>So, what is it all about?<p>The system uses ideas from ZFS (a keyed index trie, storing checksums in parent pages...) and Git (a persistent index structure that shares unchanged pages between revisions) but appends new tree roots on each commit [1][2].<p>It is a JSON DBS. The system stores fine granular JSON nodes. Thus, there&#x27;s almost no limit to the structure and size of an object. Objects can be arbitrarily nested, and updates are cheap.<p>On a high level, it supports space-efficient snapshots, tracking changes by an author &#x2F; optional commit messages, time travel queries, reverting to previous revisions (while all revisions in-between still exist for audits...), or retrieving the changes of whole (sub)trees.<p>On the one hand, it&#x27;s, thus, a bitemporal DBS, but on the other hand, it can be used as a simple event store. It stores the state after an event or a change occurs and tracks the changes.<p>Thus, an entity, a node in the JSON structure, can be updated to new values and eventually be removed while the history is easily retrievable, or we can easily revert to a previous state. The system assigns a unique ID to each new node, which never changes and is never reused (even after the deletion of the node). Thus, the system stores the state after the change&#x2F;event and the event itself (the change event).<p>The leaf pages of the index structures are not simply copied during a write, but a sliding window algorithm is applied, such that only modified nodes and nodes that fall out of the sliding window have to be written. A predefined window length is configurable. The system avoids write-peaks, which would occur due to full snapshots and having to read a long chain of incremental changes in between.<p>Thus, it&#x27;s best suited for fast flash drives with fast random reads and sequential writes. Data is never overwritten thus, audit trails are given for free.<p>Another aspect is that the system does not need a WAL (that is basically a second data store) due to atomic switches of a root index page and a single permitted read&#x2F;write transaction (txn) concurrently and in parallel to N read-only txns, which are bound to specific revisions during the start. Reads do not involve any locks.[2]<p>A path summary, an unordered set of all paths to leaf nodes in the tree, is built and enables various optimizations. Furthermore, a rolling hash is optionally built, whereas all ancestor node hashes are adapted during inserts.<p>A dated Jupyter notebook with some examples can be found in [3], and overall documentation in [4].<p>The query engine[5] Brackit is retargetable (a couple of interfaces and rewrite rules have to be implemented for DB systems) and especially finds implicit joins and applies known algorithms from the relational DB systems world to optimize joins and aggregate functions due to set-oriented processing of the operators.[6]<p>I&#x27;ve given an interview in [7], but I&#x27;m usually very nervous, so don&#x27;t judge too harshly.<p>Give it a try, and happy coding!<p>Kind regards<p>Johannes<p>[1] <a href="https:&#x2F;&#x2F;sirix.io" rel="nofollow noreferrer">https:&#x2F;&#x2F;sirix.io</a> | <a href="https:&#x2F;&#x2F;github.com&#x2F;sirixdb&#x2F;sirix">https:&#x2F;&#x2F;github.com&#x2F;sirixdb&#x2F;sirix</a><p>[2] <a href="https:&#x2F;&#x2F;sirix.io&#x2F;docs&#x2F;concepts.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;sirix.io&#x2F;docs&#x2F;concepts.html</a><p>[3] <a href="https:&#x2F;&#x2F;colab.research.google.com&#x2F;drive&#x2F;1NNn1nwSbK6hAekzo1YbED52RI3NMqqbG#scrollTo=CBWQIvc0Ov3P" rel="nofollow noreferrer">https:&#x2F;&#x2F;colab.research.google.com&#x2F;drive&#x2F;1NNn1nwSbK6hAekzo1Yb...</a><p>[4] <a href="https:&#x2F;&#x2F;sirix.io&#x2F;docs&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;sirix.io&#x2F;docs&#x2F;</a><p>[5] <a href="http:&#x2F;&#x2F;brackit.io" rel="nofollow noreferrer">http:&#x2F;&#x2F;brackit.io</a><p>[6] <a href="https:&#x2F;&#x2F;colab.research.google.com&#x2F;drive&#x2F;19eC-UfJVm_gCjY--koOWN50sgiFa5hSC" rel="nofollow noreferrer">https:&#x2F;&#x2F;colab.research.google.com&#x2F;drive&#x2F;19eC-UfJVm_gCjY--koO...</a><p>[7] <a href="https:&#x2F;&#x2F;youtu.be&#x2F;Ee-5ruydgqo?si=Ift73d49w84RJWb2" rel="nofollow noreferrer">https:&#x2F;&#x2F;youtu.be&#x2F;Ee-5ruydgqo?si=Ift73d49w84RJWb2</a>

8 条评论

BozeWolf超过 1 年前
Lets see if I can make the links clickable.<p>Was coding for fun today and was looking for a toy “database”. This is a bit too much i guess :-) ended up with flat file json. Will probably regret that later today. Good luck with the project, hope it will be (even more?) successful!<p>[1] <a href="https:&#x2F;&#x2F;sirix.io" rel="nofollow noreferrer">https:&#x2F;&#x2F;sirix.io</a> | <a href="https:&#x2F;&#x2F;github.com&#x2F;sirixdb&#x2F;sirix">https:&#x2F;&#x2F;github.com&#x2F;sirixdb&#x2F;sirix</a><p>[2] <a href="https:&#x2F;&#x2F;sirix.io&#x2F;docs&#x2F;concepts.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;sirix.io&#x2F;docs&#x2F;concepts.html</a><p>[3] <a href="https:&#x2F;&#x2F;colab.research.google.com&#x2F;drive&#x2F;1NNn1nwSbK6hAekzo1YbED52RI3NMqqbG#scrollTo=CBWQIvc0Ov3P" rel="nofollow noreferrer">https:&#x2F;&#x2F;colab.research.google.com&#x2F;drive&#x2F;1NNn1nwSbK6hAekzo1Yb...</a><p>[4] <a href="https:&#x2F;&#x2F;sirix.io&#x2F;docs&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;sirix.io&#x2F;docs&#x2F;</a><p>[5] <a href="http:&#x2F;&#x2F;brackit.io" rel="nofollow noreferrer">http:&#x2F;&#x2F;brackit.io</a><p>[6] <a href="https:&#x2F;&#x2F;colab.research.google.com&#x2F;drive&#x2F;19eC-UfJVm_gCjY--koOWN50sgiFa5hSC" rel="nofollow noreferrer">https:&#x2F;&#x2F;colab.research.google.com&#x2F;drive&#x2F;19eC-UfJVm_gCjY--koO...</a><p>[7] <a href="https:&#x2F;&#x2F;youtu.be&#x2F;Ee-5ruydgqo?si=Ift73d49w84RJWb2" rel="nofollow noreferrer">https:&#x2F;&#x2F;youtu.be&#x2F;Ee-5ruydgqo?si=Ift73d49w84RJWb2</a>
评论 #38253874 未加载
maxisaurus超过 1 年前
Congrats for this - Love the bitemporal aspect. It was a real struggle for me in past analytics experiences where we spent a lot of time recomputing key metrics &#x27;as of&#x27; certain dates for reporting &#x2F; auditing.<p>Been following this <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=38108044">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=38108044</a> as well, might interest you!
评论 #38254199 未加载
sho超过 1 年前
This looks really cool, but it would be nice if there was a clear &quot;how to run&quot; section in the README. I saw the dockerfile and docker-compose and tried to give it a shot - immediately fails. Digging deeper it seems like running on a mac isn&#x27;t supported at all. And the instructions assume a great deal of familiarity with gradle.. useful for java devs who want to contribute, maybe, but I have no idea how to build this to even test it out as a REST user.<p>Some clear guidance on how (and on what) to get it running would be useful!
lichtenberger超过 1 年前
This could be very interesting, too (our query engine now with full JSON support -- using sophisticated set-oriented join and aggregate optimizations):<p>Separating Key Concerns in Query Processing - Set Orientation, Physical Data Independence, and Parallelism<p><a href="http:&#x2F;&#x2F;wwwlgis.informatik.uni-kl.de&#x2F;cms&#x2F;fileadmin&#x2F;publications&#x2F;2013&#x2F;Dissertation-Baechle.pdf" rel="nofollow noreferrer">http:&#x2F;&#x2F;wwwlgis.informatik.uni-kl.de&#x2F;cms&#x2F;fileadmin&#x2F;publicatio...</a><p>I&#x27;ve also ported their indexing ideas regarding XML to JSON, such that we can easily index whole paths with typed values as described in the README :-) the indexes itself are also versioned, of course and always updated.<p>First AST index rewrite rules for the query engine Brackit have also been added (Brackit is regargetable, so other data stores can easily implement a couple of interfaces).
karmakaze超过 1 年前
Cool seeing this posted here. I remember making a logo for a Hacktoberfest[0].<p>It was stylized &#x27;S&#x27; to look like a space-time light cone <i>(or rotated infinity)</i>.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;sirixdb&#x2F;sirix&#x2F;pull&#x2F;105">https:&#x2F;&#x2F;github.com&#x2F;sirixdb&#x2F;sirix&#x2F;pull&#x2F;105</a>
评论 #38258175 未加载
lichtenberger超过 1 年前
If anyone is up to building a new frontend, that would be awesome (of course, work could also be split between interested people) :-)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;sirixdb&#x2F;sirix&#x2F;issues&#x2F;627">https:&#x2F;&#x2F;github.com&#x2F;sirixdb&#x2F;sirix&#x2F;issues&#x2F;627</a>
lichtenberger超过 1 年前
Can someone (an admin) maybe add the direct link to <a href="https:&#x2F;&#x2F;github.com&#x2F;sirixdb&#x2F;sirix">https:&#x2F;&#x2F;github.com&#x2F;sirixdb&#x2F;sirix</a> in the URL field. Totally forgot, that it&#x27;s possible to add both a text and a URL ;)
cognomano超过 1 年前
&gt; storing checksums in parent page<p>A Merkle tree?
评论 #38280480 未加载