Fork me on GitHub
#datomic
<
2015-10-08
>
gerstree09:10:27

@shofetim: Thanks. That's what got me started. I improved on the Dockerfile a bit, next week I will share it all in a blog.

robert-stuttaford10:10:39

what’s the most performant way to find the most recently transacted datom for a given attr?

robert-stuttaford13:10:21

@bkamphaus / @marshall : could I ask a huge favour and ask if you can get any sort of clarity on this issue for us, please? https://groups.google.com/forum/#!topic/datomic/1WBgM84nKmc

bkamphaus13:10:54

@robert-stuttaford: is there a specific aspect you want clarified? Re: changes to the behavior, we don’t have anything to report. The present recommended strategy for accommodating this is still the same, i.e. generate a unique db name with gensym or appending a uuid to the name.

robert-stuttaford14:10:32

Stu’s last message on that thread was ‘investigating a fix’ - presumably, that means, it’s not the intended behaviour. Do you plan to fix it?

robert-stuttaford14:10:36

appending a unique suffix fixes it in the short term, but that’ll bloat durable storage very, very quickly

robert-stuttaford14:10:49

gives us one more thing to manage in dev and staging environments

robert-stuttaford14:10:18

suffixes are totally fine for in-memory dbs, but then, this isn’t actually an issue for in-memory dbs

robert-stuttaford14:10:22

does that make sense?

bkamphaus14:10:33

@robert-stuttaford: I do understand the points you outline here. Just nothing additional to report at this time. The exact previous behavior is unlikely to be restored, as there was at least one bugfix related to insufficient coordination around deletion.

robert-stuttaford14:10:21

ok - all we’re really hoping to be able to do is delete and make durable databases with the same name without restarting the peer

robert-stuttaford14:10:07

even if we have to wait for a future to deliver or something

bkamphaus14:10:29

The investigation comment Stu makes is exactly that - looking into tradeoffs. We are reluctant to have people rely on create/delete in a tight cycle as a promised fast behavior. I suspect, due to how it often comes up in testing, a slow but synchronous solution won’t match what a lot of people expect. Anyways, I have brought it up with the dev team again, but can’t promise any specific outcome.

robert-stuttaford14:10:03

ok, great. thank you, Ben. much appreciated

marshall15:10:51

@robert-stuttaford: You don’t necessarily need to restart the peer process. You can ‘reuse’ DB names after a certain timeout. I just confirmed that I can successfully create a db, delete it, wait 60 seconds, then create again with the same uri and reconnect.

bkamphaus15:10:35

@robert-stuttaford: re: the earlier questions for fast query to get last datom transacted, something like (working example on mbrainz):

(let [hdb (d/history (d/db conn))]
  (d/q '[:find ?a ?attr ?aname ?atx ?added
         :in $ ?attr
         :where
         [(datomic.api/q '[:find (max ?tx) 
                           :in $ ?attr
                           :where
                           [_ :artist/name _ ?tx]]
                         $ ?attr) [[?atx]]]
         [?a ?attr ?aname ?atx ?added]]
       hdb :artist/name))

bkamphaus15:10:24

bah, hard coded artist/name in subquery is a refactoring artifact

bhagany15:10:05

I must say, I never considered using q inside a query like that before. Nice.

bkamphaus15:10:25

you can also just compose the queries, but for rest api etc. where you want everything in one query subquery is a good way to get an answer based on an aggregate, or handle an aggregate of aggregate problem

bhagany15:10:32

yes, this gets around one of my biggest bugaboos with using the rest api. I'm always trying to minimize round tripping back and forth to a peer, so this is very nice.

bhagany15:10:10

also, let this be a record of my surprise that my computer recognizes "bugaboos" as a word.

ljosa16:10:38

my biggest bugaboo is the error handling

bhagany18:10:45

@ljosa: with the rest api? if so, I hear you there.

robert-stuttaford18:10:20

must admit i’ve never seen d/q used inside a datalog clause before! in hindsight, it’s obvious that it’s possible simple_smile

domkm19:10:14

It would be nice if datomic.api was used in database functions like datomic.Peer and datomic.Util methods. Any chance of this in the future?