datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
souenzzo 2019-04-11T13:01:15.000300Z

maybe #pedestal chain? @d4hines http://pedestal.io/api/pedestal.interceptor/io.pedestal.interceptor.chain.html

2019-04-11T13:09:24.004400Z

Yeah, that’s sorta where I’m leaning. I was thinking of just a quick thing - perhaps a specialized db-> macro or function that takes db & fns where each fn accepts a db and returns some datoms. The db is passed to the first function, then the results are applied to db/with and passed to the next, until the last function, which just returns the combined transactions.

2019-04-11T13:11:43.005600Z

But pedestal interceptors are a good point, and that’s where I’m ultimately leaning. I have a lot of questions about how to do event sourcing + interceptors. I’m hoping to learn from Re-Frame and DatSys.

2019-04-11T13:29:59.014500Z

Part of my question is about how to do event sourcing in general. My only experience is with Redux (Angular ngrx actually, but close enough). It seems easy enough to have events run through some functions to produce state and effects, and some of those effects can be more events. So, kind of like the internals of Datascript itself, the system (I think it’s called a reactor?) would essentially recurse through an event loop until it reached a fixed point. If I looked at the event log, I might see one incoming IO event and 20 other events produced by interceptors in response. But, for debugging, I’d like to see the hierarchical chain - I’d like to be able to point to an event and walk up its ancestry until I get to a “root” event, or start at a root and see all the children. I’m sure these are just the basics of event sourcing, but its new territory for me, so I’m eager for input. But then again, since Datascript already has some of this functionality built in (fixed point search), I’m not sure if I need a separate thing, or merely to plug into Datascript somehow.

2019-04-11T13:33:37.017100Z

About the hierarchical chain: this is a shot in the dark, but I think the $5 word for this is data provenance. At least I saw that word on some papers cited by Eve and DatSys. But hey, reading the title of an academic paper is a far cry reading the thing itself, so I’m probably wrong 😆

souenzzo 2019-04-11T13:42:43.018100Z

@d4hines did you know #clara ? it's a forward chain engine, may will help you to "describe relations" and "let it run" without care about order.

2019-04-11T13:48:19.020900Z

I’ve heard about Clara, but I don’t really understand forward chaining rules engines, so I’ve yet to”dive in”. I’m just sorta figuring out datalog, and am super impressed with its power - I also really like the EAVT model. I recently saw this: https://github.com/clyfe/clara-eav - maybe the best of both worlds?

👀 1
2019-04-11T13:48:49.021300Z

But I think you’re right - I should take a closer look at Clara.