This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-28
Channels
- # aws (1)
- # beginners (30)
- # boot (7)
- # cider (52)
- # clara (91)
- # cljs-dev (33)
- # cljsjs (1)
- # clojure (447)
- # clojure-brasil (3)
- # clojure-dev (16)
- # clojure-dusseldorf (5)
- # clojure-filipino (1)
- # clojure-italy (29)
- # clojure-sanfrancisco (5)
- # clojure-spec (62)
- # clojure-uk (37)
- # clojurescript (145)
- # clojurewerkz (1)
- # code-reviews (12)
- # community-development (157)
- # cursive (5)
- # datascript (1)
- # datomic (27)
- # editors (42)
- # emacs (5)
- # fulcro (31)
- # hoplon (2)
- # jobs (2)
- # keechma (1)
- # lumo (31)
- # off-topic (2)
- # om (1)
- # onyx (13)
- # parinfer (8)
- # re-frame (13)
- # reagent (32)
- # remote-jobs (4)
- # shadow-cljs (103)
- # spacemacs (15)
- # specter (10)
- # sql (1)
- # tools-deps (35)
- # unrepl (13)
@adammiller correct. we're going to deploy the on-prem version on an ec2 instances backed by postgres, using the datomic-pro maven library bundled with the download. it turns out so much of our code had (datoms ...) and other peer-only features
or is it (entitiy ...) instead of datoms, some functions are only avilable on the peer server
Yeah, api is just slightly different in certain situations.
so in dev we use mount (its like sierra's component) to start datomic in memory peer, and run our tests etc, knowing it will work in production (but we are stil amateurs!! š¼ )
the other advantage of using on-prem version is that we can start postgres on our laptops and run the full version with tests, etc
Yes, I'm also using mount and I determine by the config currently whether to launch a peer or client connection then use Robert's method basically to wrap the api between client and peer api methods (https://github.com/robert-stuttaford/bridge/blob/master/src/bridge/data/datomic.clj)
i like robert's approach; it's a nice first try of bridging the gap
i would have used a multimethod or so
but still would be scared of breaking things deep inside the AWS cloudformation stack
problem with multi-method i believe is you would have to pass the mode around (at least if you were thinking of dispatching on that). His method works nice using the with-datomic-mode
macro to bind what mode we are working in.
None of this would be needed if we could launch an in memory db from code so that we could connect with the client but I don't believe that is possible.
How would i approach the abstract problem of walking a graph from leaf to root(s) with datomic. Is it even a good fit for this type of question? I understand its a graph db, but its not clear how well the semantics support this type of thing.
say n1 -> n2 -> n3 and also n1 -> n4 and just for contrast n5 -> n6 if i handed this thing n1 it would return n1 -> n2 -> n3 and n1 -> n4 but not n5 -> n6
i think component pulls nested components so thats one way to think about tackling this.
So, this is off the top of my head pseudocode but you would navigate the āedgesā that are ref
values from one entity to the other
I wonāt try to come up with a schema on the fly, but your query would look something like
hm, wait - sorry, I misread your question and was about to answer a different one š
specifically, āhow do I walk from root to leaf of a structure I knowā, where I now think youāre asking āhow do I find all the leaves and paths to them from a given root without knowledge of the structure beforehandā
Not quite. Iām saying, given a leaf, how do you walk back to the root. Put another way, given X find all the things that X depends on. I have that information in a relational format: item | deps on X | Y Y | Z But iām trying to find the right data structure for storing it for my purpose. Which is answering questions like given X walk backwards to all its deps. Then reverse that list: so foo(X) => [Z Y X] where the order represents that Ni + 1 depends on Ni
datomic or datascript might not be an ideal way todo this. But if it is, then it might offer some advantages to storing and querying that data.
In fact, after some thought, its easy enough to express this with hashmapsā¦
@adammiller no problem. Once Iāve tested it in my codebase, Iāll be happy to extract a micro-library.
@U0510KXTU I just saw this thread... did you ever extract a micro-library?
The first link on this page is wrong https://docs.datomic.com/cloud/time/log.html