Ticket #1065 (closed Task: wontfix)
Replace Neo4j by Datomic
Reported by: | jri | Owned by: | jri |
---|---|---|---|
Priority: | Major | Milestone: | Release 4.9 |
Component: | DeepaMehta Standard Distribution | Version: | 4.8.5 |
Keywords: | Cc: | dgf, Malte, JuergeN | |
Complexity: | 13 | Area: | |
Module: | deepamehta-storage-neo4j |
Description
Change History
comment:10 Changed 8 years ago by Jörg Richter <jri@…>
comment:11 Changed 8 years ago by Jörg Richter <jri@…>
comment:12 Changed 8 years ago by Jörg Richter <jri@…>
comment:13 Changed 8 years ago by Jörg Richter <jri@…>
comment:14 Changed 8 years ago by Jörg Richter <jri@…>
comment:15 Changed 8 years ago by Jörg Richter <jri@…>
comment:16 Changed 8 years ago by Jörg Richter <jri@…>
comment:17 Changed 8 years ago by Jörg Richter <jri@…>
comment:18 Changed 8 years ago by Jörg Richter <jri@…>
comment:19 Changed 8 years ago by Jörg Richter <jri@…>
comment:20 Changed 8 years ago by Jörg Richter <jri@…>
comment:21 Changed 8 years ago by Jörg Richter <jri@…>
comment:22 Changed 8 years ago by Jörg Richter <jri@…>
comment:23 Changed 8 years ago by Jörg Richter <jri@…>
comment:24 Changed 8 years ago by Jörg Richter <jri@…>
comment:25 Changed 8 years ago by Jörg Richter <jri@…>
comment:26 Changed 8 years ago by Jörg Richter <jri@…>
comment:27 Changed 8 years ago by Jörg Richter <jri@…>
comment:28 Changed 8 years ago by Malte
Hey, congrats!! I think all the third party plugin code will still work after this without any changes but lots of lines third party lines of code (thinking "getOrCreate") could, in future, *simply be removed*... Looking forward to talk about this new milestone in detail soon!
comment:29 Changed 8 years ago by Jörg Richter <jri@…>
comment:30 Changed 8 years ago by Jörg Richter <jri@…>
comment:31 Changed 8 years ago by Jörg Richter <jri@…>
comment:32 Changed 8 years ago by Jörg Richter <jri@…>
comment:33 Changed 8 years ago by Jörg Richter <jri@…>
comment:34 Changed 8 years ago by Jörg Richter <jri@…>
comment:35 Changed 8 years ago by Jörg Richter <jri@…>
comment:36 Changed 8 years ago by Jörg Richter <jri@…>
comment:37 Changed 8 years ago by Jörg Richter <jri@…>
comment:38 Changed 8 years ago by Jörg Richter <jri@…>
comment:39 Changed 8 years ago by jri
Most DM platform features are now backed by Datomic, so I could do first performance comparisons now.
The sad result is: DM with Datomic is about 5-10 times slower than with our current Neo4j/Lucene solution.
Some rough Webclient end user experiences:
Neo4j/Lucene | Datomic | |
Login | 0.5s | 5s |
Page reload | 1.5s | 7s |
I did also some formal measurement for the sole "get-all-topic-types" DB call. It loads all the 101 topic type definitions of the DM standard distro. These are the average timings:
Neo4j/Lucene | Datomic |
1433ms | 7667ms |
Despite these results I would not say that Datomic is slow in any regard. When regarding the fundamental differences between Datomic and our current Neo4j/Lucene solution the results came not as a surprise:
- The Datomic peer library (= DM app) and the Datomic transactor (= the "change" coordinator) are 2 separate processes, running in different JVM instances, and communicate via TCP sockets. In contrast Neo4j/Lucene runs in the same JVM instance as DM, no TCP communication involved.
- Datomic is an extra layer that runs on top of a 3rd-party DB product (in our case the Java embedded H2 RDBMS) which adds extra complexity (e.g. Datomic's distinctive "immutable" nature and its management of time/change).
- Datomic interprets Datalog queries. In contrast we don't use Neo4j's "Cypher" interpreter but make direct call to the Neo4j Java API in conjunction with Lucene index lookups. It is obvious that the power of a universal DB query language (like Datalog) comes at a (performance) cost.
- Datomic is written in both, Clojure and Java. For most API calls several language "interop" calls are performed. In contrast Neo4j/Lucene is pure Java. However in the face of todays highly optimized JVMs at this point I'm not sure if Datomic's "mixed language" nature implies any performance disadvantage.
What does this mean for DM?
To me these results imply that we can't use Datomic for DM. As sad as this is.
I would say that I understand Datomic and its performance influencing factors enough to say that no further measures would lead to substantially better results. I would even say that no DB engine which offers a universal query language could ever yield the performance of our current storage solution. The Neo4j/Lucene performance is a result of the very fact that it does NOT offer an universal query language.
The perspective I see is to NOT continue the search for a DB alternative for DM at the moment, but to go with what we have. To the DM application developers this means that more post-processing of DB results must be performed at application level.
The need for arbitrarily complex DB queries was the very origin for exploring other DB systems for DM such as Datomic or Neo4j 3.0. However with the new experience described here I rather think we must either 1) lower our performance demand, or 2) rethink DM's data/storage model.
comment:40 Changed 8 years ago by Jörg Richter <jri@…>
comment:41 Changed 8 years ago by jri
- Status changed from accepted to closed
- Resolution set to wontfix
Work on Datomic is discontinued