Fork me on GitHub
#datomic
<
2018-03-28
>
Datomic Platonic00:03:44

@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

Datomic Platonic00:03:32

or is it (entitiy ...) instead of datoms, some functions are only avilable on the peer server

adammiller00:03:23

Yeah, api is just slightly different in certain situations.

Datomic Platonic00:03:54

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!! šŸ˜¼ )

Datomic Platonic00:03:27

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

adammiller00:03:00

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)

Datomic Platonic00:03:06

i like robert's approach; it's a nice first try of bridging the gap

Datomic Platonic00:03:56

i would have used a multimethod or so

Datomic Platonic00:03:25

but still would be scared of breaking things deep inside the AWS cloudformation stack

adammiller00:03:45

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.

adammiller00:03:47

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.

noonian00:03:50

Would be amazing if datomic-free supported the client api

Drew Verlee01:03:34

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.

Drew Verlee02:03:57

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

Drew Verlee02:03:21

i think component pulls nested components so thats one way to think about tackling this.

Chris Bidler02:03:49

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

Chris Bidler02:03:09

I wonā€™t try to come up with a schema on the fly, but your query would look something like

Chris Bidler02:03:21

hm, wait - sorry, I misread your question and was about to answer a different one šŸ™‚

Chris Bidler02:03:10

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ā€

Drew Verlee13:03:42

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

Drew Verlee13:03:51

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.

Drew Verlee16:03:02

In fact, after some thought, its easy enough to express this with hashmapsā€¦

steveb8n04:03:16

@adammiller no problem. Once Iā€™ve tested it in my codebase, Iā€™ll be happy to extract a micro-library.

bmabey04:04:57

@U0510KXTU I just saw this thread... did you ever extract a micro-library?

jaret13:03:04

Thanks for catching that! Iā€™ll correct that today.