Fork me on GitHub
#datomic
<
2016-12-19
>
tjtolton01:12:01

Hmm, interesting

tjtolton01:12:56

another from that post: >Keep metrics on your query times >Datomic lacks query planning. Queries that look harmless can be real hogs. The solution is usually blindly swapping lines in your query until you get an order of magnitude speedup. what does he mean by "query planning"? is this a feature of databases that datomic lacks, or is this a comment on how datomic is used?

marshall01:12:13

You can usually do much better than "blindly swapping" clauses

xk0504:12:11

getting ready to do a CloudFormation install

robert-stuttaford04:12:15

this has turn-key datomic transactor + apps + memcached + ddb

xk0504:12:07

reading...

xk0504:12:17

this may be overkill for my purposes

xk0504:12:09

it's good to see there is scaffolding in place, though

xk0504:12:54

the clojure community is always leaving presents under the tree for me in this regard

xk0504:12:22

I just listened to the Cognitect podcast with Paula? Gearon. Man, the things she was saying! Many of the very same things that have bugged me for years. What a joy to come back to this topic now, and a RDF layer in the works. I look forward to developing some ideas on this platform.

xk0504:12:02

I made an attempt to write a functional triplestore with owl2 rules a few years back, after spending a winter studying the topic at Univ. of Washington. It was just a sort of moonlighting hobby thing to sketch out ideas of where I might want to go later. My implementation was in elisp with ttl flatfiles with allegrograph and gruff support. It's a boneyard of broken dreams. 😄 Well, really though, I look at it from a distance now, and it really does appear that this database and the support repositories growing up around it are a mature application of those very ideas. I guess this is a long-winded way of saying, "Wow! Somebody actually made this work!"

xk0504:12:55

When my fire started to peter out I just sort of dumped it into a bucket here. I was sort of planning on organizing it, then I stumbled onto this. I may just convert the little bits I want to keep to clojure and work on this format instead.

robert-stuttaford06:12:38

i highly recommend spending some time with Datomic, then @xk05 - i think you’ll find the more you use it, the more you see the beauty of its overall design.

kennethkalmer12:12:38

I just bumped to 1.9-alpha14 and datomic 0.9.5544 and I’m suddenly seeing different variations on the same exception (still debugging)

kennethkalmer12:12:56

java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: :db.error/not-a-keyword Cannot interpret as a keyword: restricted, no leading :

kennethkalmer12:12:21

went through the datomic google group and google itself, but this one seems ungoogleable 😞

kennethkalmer12:12:51

has anyone else seen this happen yet?

kennethkalmer12:12:27

found it, I’m passing a string value to a keyword attribute

kennethkalmer12:12:38

guess in the past it would have just cast it

adamfrey14:12:33

@marshall did you, by chance, test out the runtime-varying AND query I was trying to build on Thursday? https://clojurians.slack.com/archives/datomic/p1481841384000992

adamfrey15:12:02

I’ve found I can generate the a where query at runtime like this

{:find  '[?e]
 :where (for [aka akas]
               ['?e :aka aka])}
and that might be the idiomatic way, I just want to make sure I’m not missing anything

marshall15:12:48

@adamfrey I didn’t get to it over the weekend, but if you have a good programmatically generated solution, I’d go with that.

Lone Ranger20:12:08

alright lovely folks, maybe you guys can help me convince my company to adopt Datomic (finally) 😄 Have this SQL problem. T1 has about 2.5 millions rows, about 20% are duplicates. T2 is a near clone of T1 with no duplicates. However, T2 has more recent entries than T1. I need to get all unique new entries from T1->T2. Seems to me like it should be a simple set operation but in SQL it is enormously computationally expensive. Is this something on which Datomic can save me or am I still screwed? 😛

Lone Ranger20:12:38

I mean as the axis of time progresses I'm surely screwed in general but I'm hoping in this instance there may be some light 😂

gdeer8120:12:14

well from a scalable architecture point of view you could argue that you could run a computationally expensive read query like that on a peer without bringing down the entire system because other peers will be able to make writes and do queries without being impacted

tjtolton20:12:57

in a related question, does the horizontal read scaling of datomic have any advantages over, say, read slaves?

matthavener20:12:42

tjtolton: unlike read slaves, datomics “slave lag” is reified and you can determine which basis your current database is at

matthavener20:12:12

with regular read slaves (at least in my limited experience), you cannot determine if the database you’re reading from has changes some arbitrary transaction

tjtolton20:12:40

thats pretty significant

matthavener20:12:43

yeah, I saw a nasty bug once due to a race with read lag. its worse because you only see the read lag bugs when load is high

matthavener20:12:54

(or during some network partition)

tjtolton20:12:50

so, with datomic, i suppose you would use the sync operation to solve that?

Lone Ranger20:12:06

@gdeer81 you are correct, however, I need to run this update ~ every 5 minutes

Lone Ranger20:12:59

would be very nice if could get something going like T3 := set(T1) - set(T2) (pseudo-code)

tjtolton20:12:29

@goomba you'd spin up a new app process to do it each time, I think is what he's saying.

Lone Ranger20:12:52

@tjtolton correct, only issue is that the above operation on SQL takes several hours to complete

Lone Ranger20:12:00

and since I need to run it every few minutes...

Lone Ranger20:12:51

there are, I'm sure, other way to do it a la "well why don't you just..." ... but it would be REALLY nice if we could just leverage immutable data structures 😂 😂 😂

gdeer8121:12:03

@goomba first you would need to convert your sql schema to datomic schema then migrate all your current data over, then rewrite your app to use datomic. doing all that might prevent the original problem you were having

Lone Ranger21:12:51

@gdeer81 more than happy to do that, this is more of a feasibility question. And yes preventing the original problem would certainly count for me as solving it!

Lone Ranger21:12:28

This whole situation came about because trying to prevent duplicate entries on insert means an insert speed of about 20-25 records per second while we generate about 30-35 records/second

Lone Ranger21:12:09

so to prevent this we created a table where we don't check for duplicates, giving us an insert speed of 4k records/second, but now we have duplicates

gdeer8121:12:13

I'm not sure what Datomic's write throughput max is, but assuming that one record would break out into at least 10 datoms, you're talking about being able to transact 40k datoms per second.

Lone Ranger21:12:29

well. That would certainly work.

gdeer8121:12:51

I'm saying I don't know if Datomic was designed for that kind of churn

gdeer8121:12:38

but don't let me discourage you from trying it

Lone Ranger21:12:50

well the good news is use we mongoDB as a buffer to handle the inserts

Lone Ranger21:12:10

and I can drip feed with some buffer the info from mongo into Datomic

Lone Ranger21:12:19

and it doesn't have to be up-to-the-second accurate

gdeer8121:12:49

so you'd be using mongoDB as a queue?

Lone Ranger21:12:03

it's our long term storage

Lone Ranger21:12:11

but as you know not great for queries

gdeer8121:12:28

I really hate to discourage anyone from trying Datomic but your original problem could probably be solved with Informatica or writing your own de-dup process in Clojure

Lone Ranger21:12:13

Not discouraged, just looking for any excuse to push for Datomic right meow 😄

Lone Ranger21:12:54

damn, I might literally have to do this in Clojure. It just takes up too much damn memory in Python

kenny21:12:12

When trying to require the datomic clj-client I get this error:

java.lang.UnsupportedClassVersionError: org/eclipse/jetty/client/HttpClient : Unsupported major.minor version 52.0
clojure.lang.Compiler$CompilerException: java.lang.UnsupportedClassVersionError: org/eclipse/jetty/client/HttpClient : Unsupported major.minor version 52.0, compiling:(cognitect/http_client.clj:1:1)
I don't have any dependency conflicts with jetty. How do I use the clj-client?

gdeer8121:12:02

what jdk are you using?

kenny22:12:25

I was using 7 and I just switched to 8 and it's working. If it's not already documented, that should be added 🙂

kenny22:12:20

What params do I need to pass to connect in the client API if I have a database running on Dynamo? For :db-name I put my db uri "datomic:". It's not clear what I am supposed to put for :account-id and :access-key. Also, do I need to specify any more of the optional keys?

kenny22:12:46

From the docs: > :account-id - must be set to datomic.client/PRO_ACCOUNT Does this mean I don't need to specify this value? Or should it be set to my AWS access ID? Or maybe my my.datomic account id?