Better HN
topnewbestaskshowjobs
Log inSign up

refset

1,514 karma · joined Aug 24, 2015 (11y ago) · 537 submissions

https://github.com/refset

[ my public key: https://keybase.io/refset; my proof: https://keybase.io/refset/sigs/pyTK0thu8g5O4Zs7EA3HrQYKkYZjeEz_TUr8nZV2hlY ] c0ba44896414421c9009bc8a77a86ceb

meet.hn/city/51.0612766,-1.3131692/Winchester

Socials: - github.com/refset

---

Submissions

comment 6y ago · link · parent

The Strange Loop 2019 talk linked by the GP is more recent and contains more technical details, but yes the Clojure/north talk is a nice bit of history showing the unveiling :)

My personal favourite is the talk from ClojuTRE by the main architect behind Crux, which looks under the hood a lot more and discusses many of the key design trade-offs during initial implementation: https://youtu.be/YjAVsvYGbuU

comment 6y ago · link · parent

I can only guess what was meant, but I suspect the main argument is that projection code in an event sourced system is much more nimble when it's not tied down to an underlying schema. Documents make focusing on language level types much easier.

That said, we've not built Crux with domain-level event sourcing in mind in particular. There is certainly overlap in the bitemporal model Crux has and what I gather some people are doing with retroactive events.

This blog post on Datomic and event sourcing is interesting and relevant for Crux also (Crux has been heavily inspired by Datomic): https://vvvvalvalval.github.io/posts/2018-11-12-datomic-even...

comment 6y ago · link · parent

Hi everyone, thanks for the interest!

I help steer the roadmap for Crux, which is very openly visible on GitHub, and we have a 1.9 release coming up in the next couple of weeks which will be the most significant milestone since we launched last year.

Shortly after 1.9 we will be adding SQL query support, which uses Apache Calcite to compile SQL into Datalog on-the-fly, and end-to-end JSON APIs. Both of these together should really broaden the appeal of Crux far beyond Clojure and the Java/JVM communities. Stay tuned!

I would be very happy to answer any questions and hear feedback, as ever.

comment 6y ago · link · parent

It's usually no more than a day or two's work for us to get a new dialect figured out and to wire up CI tests with containers etc.

It wouldn't be infeasible for someone new to Clojure to manage it about the same time also. The hard part is the SQL, not the Clojure.

Fortunately there actually is SQL Server support already: https://github.com/juxt/crux/blob/master/crux-jdbc/src/crux/...

...and I'll make sure the full range of backends is made clearer somewhere. Good feedback!

comment 6y ago · link · parent

That's a pretty accurate summary. Documents are very straightforward to reason about at a transactional level, particularly when handling unpredictable changes to data models.

Once documents are ingested into the EAV-like indexes you can query everything much the same as a typical graph database, because all the ID references within the documents translate into edges within a schemaless graph of entities.

Crux's native query language is a flavour of Datalog but we also have a SQL layer in the works using Apache Calcite, for a more traditional relational feel.

comment 6y ago · link · parent

It's worth noting that Crux supports a healthy range of options for transaction log and document storage beyond Kafka, including a variety of JDBC backends (SQLite, Postgres etc.)

Kafka is usually more than most people want or need. There was a blog post recently about a new Firebase-like Clojure web framework which uses Crux + Digital Ocean's managed Postgres service: https://findka.com/blog/migrating-to-biff/

Disclosure: working on Crux :)

comment 6y ago · link · parent

It's worth a mention that there is a next level of challenge for backfilling and correcting historical data - that's when a bitemporal data model is a good idea. In other words, keeping track of the "valid time" (or "application time") of when a fact became true, separately from the "transaction time" (or "system time") of when the fact was ingested into the database.

> you don’t need any special tools

Absolutely agreed. I happen to work on https://opencrux.com which is designed from the ground up for handling bitemporal data, but I was chatting to someone a couple of days ago who built a really neat approximation of Crux purely on Postgres, using JSON columns and 3 simple tables: Transaction_Log table + All_Documents table + Current_Documents table. A small handful of triggers were used to automate the timestamping and the population of the Current Documents table, but it was super simple stuff.

Naturally there is a big difference in scale and performance compared to something like Crux (where you can join within historical timeslices _efficiently_), but I was impressed by how flexible JSON indexing in Postgres made the approach viable with such little upfront effort.

It's probably fair to say that the majority of queries in typical applications won't ever care about prior history, but I think always having history available for native querying without having to import anything from archives or logs is fundamentally liberating.

comment 6y ago · link · parent

Crux is designed to scale directly based on how RocksDB (or LMDB) performs on a single node, in terms of: sustained ingestion throughput, KV seeks/sec, and the sheer quantity of KV data that can be supported on an array of local SSDs (i.e. easily many billions of small docs). At a higher level this means that point-in-time queries will maintain good performance regardless of how much history is stored, thanks to Z-order indexing [0], and the query algorithm only requires very modest amounts of memory because the KV indexes are lazily streamed out of Rocks and processed tuple-by-tuple (though having more memory is always going to speed things up!).

Beyond the scope of a single Crux node, horizontal read scaling comes for free due to the transaction time model of history (i.e. you can spin up N identical nodes to service all manner of wholly unrelated use-cases with consistent reads).

[0] https://en.wikipedia.org/wiki/Z-order_curve

comment 6y ago · link · parent

I don't have experience with either RecallGraph or ArangoDB but I have been following the project for a few months now - kudos to the team for releasing 1.0!

Naturally there are a few other open source technologies exploring the "temporal graph" space, including TerminusDB [0], which uses a git-like branching history model for data collaboration, and Crux [1], which supports bitemporal history for transactional workloads (full disclosure: I work on Crux directly). Datahike [2] is also worth checking out if you've not seen it. Both Crux and Datahike are heavily inspired by Datomic.

However, if the history-aspects of your data model end up being more complicated than the graph-aspects of your data model, then you may well be better off using SQL temporal tables as implemented by Teradata / SAP HANA / DB2 etc.

[0] https://terminusdb.com/

[1] https://opencrux.com/

[2] https://github.com/replikativ/datahike

comment 6y ago · link · parent

That's right, we're certainly keen to help all JVM users who wish to embed Crux, and for users sitting outside the JVM we have significantly more comprehensive JSON support and SQL queries in the works too.

Our upcoming SQL module is based on Apache Calcite which does a lot of heavy lifting and compiles SQL joins to Crux's native Datalog. For the curious: https://github.com/juxt/crux/blob/0f7d9c66db952a65efb4cba7e3...

comment 6y ago · link · parent

Note that temporal databases are also a thing, so it's probably wise to avoid using the word "temporal" when discussing time series databases. As far as I know kdb+ is the only technology that has a foot in both camps.

https://en.m.wikipedia.org/wiki/Temporal_database

comment 6y ago · link · parent

I think reversible SVG animation on scroll effects _can_ be quite neat, e.g. https://www.opencrux.com/

It's far preferable to most scroll-related effects I've seen.

comment 6y ago · link · parent

This is almost certainly lower-level than what you are looking for, but I think you are describing a bitemporal graph data model: https://opencrux.com

comment 6y ago · link · parent

My favourite computer-related quote: "programming is applied philosophy" (origin unknown, sorry!)

comment 6y ago · link · parent

State-backed application of behavioural economics [0] was the driver behind the RNG overhead, not efficiency: "Premium Bonds were introduced [...] to control inflation and encourage people to save" [1]

[0] https://en.wikipedia.org/wiki/Prize-linked_savings_account#E...

[1] https://en.wikipedia.org/wiki/Premium_Bond#History

comment 6y ago · link · parent

The transcript & slides on a single page: https://github.com/matthiasn/talk-transcripts/blob/master/Hi...

Regardless of Clojure's ultimate fate as a language implementation, I suspect that the magical combination of `Epochal Time Model + Persistent Data Structures + Pure Functions` is fairly future-proof.

comment 6y ago · link · parent

Richard was a beautiful soul who recognised, embraced and embodied the primacy of love. His life was his message.

comment 6y ago · link · parent

Duly noted - sorry for diluting attention.

Connecting both aspects though: arguably the failure of subsequent technologies to fulfill the decentralized Notes vision has facilitated the rise of extreme centralization and greatly exacerbated our privacy problems.

comment 6y ago · link · parent

I think Lotus Notes has a fascinating history, cryptographic shenanigans asides. As far as I'm aware it is still the most successful "offline first" / "local-first" application platform in widespread use today, complete with multi-master document replication, highly-configurable conflict resolution and rapid application development. These were revolutionary capabilities during the dialup era. The email client just happens to be the most popularly recognised groupware application outside of individual corporate firewalls.

The original vision was very lofty: https://web.archive.org/web/20180225100127/http://www.kapor....

"Notes should take the first major crack at the area of idea processors, textual databases, and hypertext systems."

I would love to see where an open source equivalent built for the modern age could take us... (CouchDB gave it a good shot!)

comment 6y ago · link · parent

Documents are best thought about in terms of being the unit of ingestion and history - they do not have strong implications for queries asides from having a 1:1 mapping with entities.

Each transaction may contain multiple operations and each operation is typically only relating to one document. A document represents a single version of an entity and is decomposed during ingestion into an arbitrary set of attribute-value datoms that get updated atomically and fully replace all the previous attribute-value associations of the given entity.

For more on the semantic differences with datoms see the FAQ: https://www.opencrux.com/docs#faq-comparisons

comment 6y ago · link · parent

This is a good summary!

I think the biggest reason why bitemporality hasn't seen widespread adoption is that it's a hard problem, both for DBMS implementers to solve and for users to adopt, when constrained to a world of SQL and tables.

Crux not only has first-class support for bitemporality in the core engine but saves the user from having to worry about how and when bitemporality impacts the schema. This is because everything in the database gets a bitemporal history by default, without the user needing to make upfront designs & decisions.

Point-in-time Datalog queries traverse the entity graph using a very simple schema-on-read behaviour and this can serve as a foundation for more complex relational modelling and constraint enforcement.

comment 6y ago · link · parent

Hello! I am the product manager for Crux. I will try to answer questions when I get back online in a few hours.

Something not mentioned in the post is that there is a Java API in addition to HTTP and Clojure.

The Beta programme is commencing very early in 2020 - please contact us in the meantime if you are interested to hear more: crux@juxt.pro

comment 6y ago · link · parent

> What's the indexing/performance like?

A key goal has been to avoid ingestion bottlenecks that are otherwise typical when indexing late-arriving temporal data. This is partly achieved by having a very simple EAV index structure over fast local KV stores like RocksDB and LMDB (as opposed to a complex distributed storage architecture with vastly more moving pieces).

As for query performance, the indexes have been designed so that graph traversals are efficient regardless of how much transaction time or valid time history is stored for the entire database of entities. One trick to this is the use of "Morton space filling curves": https://github.com/juxt/crux/blob/master/crux-core/src/crux/...

This is a great talk about the design and internals from ClojurTRE 2019 if you're curious: https://www.youtube.com/watch?v=YjAVsvYGbuU

comment 6y ago · link · parent

Crux uses a Worst-Case Optimal Join [0] algorithm with bitemporal indexes, and the Datalog-specific query layer is implemented in less than a thousand lines of Clojure: https://github.com/juxt/crux/blob/master/crux-core/src/crux/...

SQL certainly provides a lot of bells and whistles but Crux has the advantage of consistent in-process queries (i.e. the "database as a value") which means you can combine custom code with multiple queries efficiently to achieve a much larger range of possibilities, such as graph algorithms like Bidirectional BFS [1].

[0] https://arxiv.org/pdf/1803.09930.pdf

[1] https://github.com/juxt/crux/blob/master/docs/example/imdb/s...

comment 6y ago · link · parent

1) the single-writer principle of the transaction log means there's no need for any transactional locking

2) the separation of reads and writes allows for elegant horizontal read-scaling without coordination/consensus

3) pluggable storage backends implemented as simple Clojure protocols (as the sibling comment mentions), which eliminates a large number of performance and durability concerns

4) combining schema-on-read with entity-attribute-value indexing means there's no need to interpret and support a user-defined schema

5) Datalog is simpler to implement and use than the full SQL standard or alternative graph query languages

...I work on Crux :)

comment 6y ago · link · parent

Datomic provides a fantastic range of query features, but the underlying Datalog engine does have drawbacks in how it evaluates results eagerly and requires intermediate result sets to fit in memory [0].

For comparison, I work on https://opencrux.com which uses lazy Datalog evaluation and can spill to disk when necessary. Naturally there are downsides to this approach also, including a dependence on seek-heavy use of local KV indexes.

clj-3df is definitely interesting although not strictly comparable :)

[0] https://docs.datomic.com/on-prem/query.html#memory-usage

comment 7y ago · link · parent

I believe Aaron Hsu's work on tree processing for Co-dfns [0] is a novel example of tree handling - a data parallel compiler for efficient compilation on a GPU using extensive tree-oriented "nanopass" transformations [1].

[0] https://github.com/Co-dfns/Co-dfns

[1] https://dyalog.tv/Dyalog18/?v=hzPd3umu78g

comment 7y ago · link · parent

I work on Crux [0], which is also a Java-friendly Datalog database. It sits on top of lazy EAV indexes in RocksDB/LMDB so it's pretty fast and scales well (though technologies like Neo4j/GraphBLAS will be faster!).

We don't have online REPL just yet but Nextjournal is pretty great if you want to play through the tutorials interactively [1]. The other unique angle is that Crux gives you "bitemporal" Datalog queries. Oh and the MIT license :)

[0] https://opencrux.com

[1] https://nextjournal.com/crux-tutorial/

comment 7y ago · link · parent

> temporality will become important as well because it matters how information changes over time. Current systems are not able to account for this because of the large overhead of storing extracted information

This quote happens to be in the context of video frames but I think temporal indexing in general is widely under-utilised, both for providing consistent queries (i.e. the database-as-a-value) and for integration of late-arriving data (i.e. bitemporality). It seems particularly relevant when considering how best to synchronise information across the "omnipresent Internet of Things" (not to mention inter-planetary devices, which also get a mention in the post!).

comment 7y ago · link · parent

I agree. Bitemporal databases can natively handle late-arriving data in these kinds of upstream timestamp integration scenarios.

However, the intersection of bitemporal indexes and columnar time-series queries seems important and yet I haven't seen anything that looks like it might offer both, possibly asides from kdb+ and SAP HANA.

Disclosure: I work on https://github.com/juxt/crux (which is optimised for bitemporal graph joins and doesn't currently employ columnar indexes)

1
1415161718