Fork me on GitHub
#datomic
<
2017-06-22
>
stijn08:06:08

How are you all structuring your code for database functions? I assume: have small interfaces in datomic and put the rest of the code on the classpath of the transactor?

shaneprince09:06:53

Cheers @timgilbert! Very useful 🙂

robert-stuttaford09:06:46

@stijn i really dislike that approach because it means regular transactor downtime (every time you have code to deploy)

pesterhazy11:06:33

transactors should be as disposable and hands-off as possible

pesterhazy11:06:58

e.g. using cognitect's AMIs, where it's hard to pull in extra dependencies

uwo13:06:51

@favila excellent. thanks!

marshall13:06:21

@uwo Note that those peers are still able to write to the Datomic instance (i.e. submit transactions), as that work is handled through peer->transactor->storage

uwo13:06:34

ah, of course. so, that configuration would be somewhat pointless, then? @marshall

marshall13:06:33

it probably isn’t a terrible idea just in the sense that your peer user creds are less open

marshall13:06:47

but it wouldn’t result in a ‘read only’ peer

favila13:06:33

Ah I misunderstood what you were after @uwo. With respect to storage, all peers are read-only. But there's no way to turn off their ability to submit txs to the transactor

uwo13:06:02

yeah. I wasn’t thinking through clearly.

marshall13:06:09

incidentally, I believe ‘read only peer’ would be appropriate as a feature request in our portal - I’d suggest you add it there if it’s not already in there

uwo13:06:47

thanks, request made.

harold17:06:59

It looks to me like com.datomic/datomic-pro "0.9.5561" depends on org.apache.httpcomponents/httpclient "4.5.2" which depends on commons-codec "1.9". But com.datomic/datomic-pro "0.9.5561" also depends on commons-codec "1.5" directly, overriding httpcomponents' dependency and forcing the older 1.5 version of commons-codec. Is this right? Is it good? What is the reasoning? If the code in datomic-pro is compatible with commons-codec 1.9, then I think removing the direct dependency on 1.5 is a good idea.

kjothen20:06:20

Are there any performance improvements to be gained by using enums for attributes that are in some sense bounded? For example, I have a lot of data that needs to be retrieved by day (in the bi-temporal sense, not the t). Indexing millions of entities by day seems wasteful if the universal set of days is bounded to a few years, e.g. :as-of/+20170622 is not too cumbersome to use. Basically, will I get the same query performance swapping out indexes for enums?

timgilbert20:06:37

@harold: I've just added a [commons-codec "1.10"] top-level dependency to my project.clj in order to pin the dependency, personally (I'm extra-paranoid about class-loading conflicts)

harold20:06:33

@timgilbert - that sounds dicey too, if httpcomponents depends on 1.9 specifics the change you suggest could break it (same for datomic and commons-codec 1.5, and datomic's explicit direct dependency suggests to me that it does depend on 1.5 specifics).

timgilbert20:06:18

I agree, but to me that diceyness is a lot more palatable than the diceyness of "include two copies of these classes in the classpath and let the fates decide which version the JVM will load on each invocation"

timgilbert20:06:56

FWIW, from the changelog of commons-codec it looks like largely just bugfixes in more recent versions

harold20:06:22

@timgilbert - If you use lein it's not as bad as that. On a related note, have you seen https://github.com/walmartlabs/vizdeps ?

Alex Miller (Clojure team)20:06:42

lein or mvn will pick one, not include both (but that one might not be the one you want)

timgilbert20:06:52

Oh right. Well, build-time uncertainty is better than run-time uncertainty, but not by that much

harold20:06:18

@alexmiller - any thoughts on this conflict? Is there a better place to report/post it?

Alex Miller (Clojure team)20:06:43

if you have a Datomic support account, those channels are fine

harold20:06:53

@alexmiller - Oh, didn't think of that. I don't interact much with the datomic licensing stuff we do. Thank you.

jaret23:06:39

@harold we'll look into that. I'll get back to you with findings

harold16:06:36

jaret: Sounds good. I'm not on this slack much, feel free to email me at <mailto:[email protected]|[email protected]> if I can be of service.