Couldn't find something like a https://github.com/tonsky/datascript/blob/eb8ba4cd7217640b282a25ca2adda93183a9a4cf/src/datascript/core.cljc#L564 in Asami, the datascript implementation looks straightforward. I'm planning to use Asami with re-frame in the browser and kind of require this. Is this something word adding to Asami?
I might be wrong but I think Asami's query optimizer might really shine with re-frame, since on every single transact (any state change of the app-db), all http://day8.github.io/re-frame/subscriptions/#why-layer-2-extractors will run and query the db.
the problem with asami is that it is designed for reading, not writing. transactions are deadly slow
it could rather be alongside db in re-frame, but not really as a replacement
then there is no need to refresh the views in case of transactions, because it is better not to do too many transactions. Even if you would like to, the time saved by the planner will be wasted
Oh okay, didn't know that Asami is designed primarily for reading. Thanks 👍:skin-tone-4:
It all depends on what kind of data you have and how fast it changes
adding 20k entities to asami takes 2500ms where datascript needs 1500ms
If you need to retrieve data from BE and display it to the user using complex queries, then asami is much better than anything else.
I wanted asami to replace the global atom in re-frame. Which means it would be transacted upon on almost every kind of user interaction. Maybe a max of 30 transactions per second (naive figure after checking my redux dev tools for how many max actions are usually dispatched per user interaction)
if you want to keep a small amount of data that you operate on frequently, I recommend that you see how fulcro does it. There is a lot going on around this topic, a solution you can use in re-frame is autonormal
Great, my main intention was to keep the app db normalized, and the autonormal library might be what I am looking for
pull syntax
/`eql` does not give you the same power as datalog, but it is usually sufficient
if you already have a normalized DB that is as flat as possible, a good solution for more complex queries is a meander
Yeah, I've dabbled with fulcro, kind of liked how the component was "hooked" to the app db using the EQL graph query, but felt the API surface layer was too big and the code didn't feel "neat"
I also much prefer the re-frame, and have made many approaches to fulcro in my spare time. it's big and clunky, but solves many problems.
here you can find an example how to mimic datascript using meander
(reading through meander's README)
I have to go
good luck!
Thanks a lot ribelo, that was of great help!