datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
Oliver George 2018-11-26T00:26:42.027800Z

Are there any rules of thumb about how many facts datascript can comfortably support before performance gets tricky. I'm thinking about suitability for use with re-frame for a webapp and re-natal mobile app.

fmjrey 2018-11-26T10:46:27.028300Z

I would be curious to know too.

2018-11-26T11:58:55.028800Z

I think you'd probably run into memory issues before datascript performance became an issue

2018-11-26T11:59:30.029300Z

Doubt it's a concern in most typical web/mobile apps, if you would be storing everything in memory anyway

Oliver George 2018-11-26T22:42:49.030900Z

I'm thinking 10k facts is likely. That'd save lots of network traffic for looks ups to essentially static data. Can't see getting to 100k facts.

Oliver George 2018-11-26T22:44:51.032900Z

Newbie observation: When I put a datascript db inside by re-frame.db/app-db and use their debug interceptor I get an error. The error occurs when clojure.data/diff tries to compare the before and after db.

Clojure 1.10.0-beta8
user=> (require 'clojure.data)
nil
user=> (require 'datascript.core)
nil
(clojure.data/diff
  (datascript.core/empty-db)
  (datascript.core/db-with
    (datascript.core/empty-db)
    [{:a 1}]))
Execution error (ClassCastException) at user/eval5 (REPL:1).
datascript.db.Datom cannot be cast to java.util.Map$Entry

Oliver George 2018-11-26T22:46:50.034500Z

I realise diffing the db is silly but it does seem like a bug.

Oliver George 2018-11-26T22:46:57.034800Z

Is this worth logging as a bug?