Fork me on GitHub

@robert-stuttaford I did some work with terraform. Found the infrastructure as code to be incredibly valuable


we were using CFN for both infrastructure and provisioning before. separating them into two codebases (terraform and ansible) has simplified both sides quite a bit. <strikethrough>decomplection</s> simple wins again!


is there a non-hacky way to pipe logs produced by the transactor binary to syslog?


big thumbs up for terraform as well. If Datomic would support that as alternative way and officialy support terraform modules that would be awesome <wink>


Having a doubt about the behaviour of datomic.api/transact-async. Does it return (its Future) immediately or is there a blocking part to the call?


IIUC seems to me transact-async makes an attempt to contact the transactor before returning,


Seems to me that might only apply to transact, I'll let someone else answer definitively. You could see what happens when you transact-async and the transactor is down


Using pull, can I add transaction metadata of a nested entity?


For example:

{:find [(pull ?e 
         {:con/items [:item/id {:item/data [...]}]}
        ]) ...]
 :in $ ?cl
 :where [[?e :con/class ?cl]]}
How to add transaction metadata to all item-entities (`:item/id`)?


@kurt-yagram you can't reach tx via pull, because txes aren't linked to e via a. d/pull (like d/entity) is about traversing e <=> a relationships. you can reach via d/q clauses (via fourth binding position) or d/datoms (via :tx)


in your code, you'd add ?tx after ?cl in your where clause, and then you can do a separate (pull) on that in your find.


yeah, but that doesn't fetch me the tx's of the items. A separate pull/query is necessary... Thx!


are datomic rules evaluated in order? as in, if I have 3 rules with the same name defined in one vector , then the first one is checked first?


the behavior I’m seeing would suggest otherwise, but want to be sure I’m not missing something

Ben Kamphaus14:09:54

@ethangracer can you describe how you believe the order would matter in your case?


afaik, in the order you've written them


looking forward to discovering if i'm mistaken, though 🙂


@bkamphaus the database is configured so that I have item templates and item instances (kind of like classes vs objects in OO). So if an item instance has the :item/tag field, I want to get that field instead of getting the :item/tag field on the item template


so I wrote the following 2 rules:

‘[[(item-with-attr ?item ?attr ?value)
   [?item ?attr ?value]
   [?item :item/template _]]
  [(item-with-attr ?item ?attr ?value)
   [?item :item/template ?template]
   [?template ?attr ?value]]]


the idea being, if the entity is an instance, get me the value on that instance. if the instance doesn’t have that field, then go and get me the attribute on the template


the behavior is currently nondeterministic — if I add additional schema, the rule sometimes returns the template attribute (`:item/tag`, in this case) before the instance attribute

Ben Kamphaus14:09:58

“if the instance doesn’t have that field” - rules are not meant to guarantee an order to implicitly handle what you mean to be a conditional evaluation on something not being there (unless there’s a specific not cause). I would use missing or a not clause explicitly.


@bkamphaus awesome, that worked, thank you! if rules don’t guarantee an order to handle conditional evaluation, why can you use multiple rules in place of an or or or-join? Just want to make sure I understand the distinction

Ben Kamphaus14:09:12

because you only have to fulfill one criteria in the or to return true. I guess there could be performance implications for which clause is matched, but any clause should be sufficient to fulfill the criteria.


got it, that makes sense


doesn’t quite work like or in a programming language then, where it ignores all false values (in order) until finding the first true value

Ben Kamphaus14:09:14

yeah, I don’t want to speak too generally about when order is/isn’t guaranteed but you should always approach the correctness aspect of any query as if order doesn’t matter. Clause ordering typically only matters e.g. within a where clause for performance reasons, filtering the set down to smaller intermediates rather than larger ones.

Ben Kamphaus14:09:07

the or short-circuit behavior you describe where you want the first truthy thing is definitely a different beast. I think with datalog (or even SQL, etc. for that matter) it’s easier to just think of set unions and intersections, etc.


ahh, right. rules being literal substitutes for where clauses helps to clarify that distinction. I’m definitely still new to database programming in general, so I appreciate the tip about considering queries in terms of set operations rather than programming constructs.


@jared sorry for the long response time. I tried a lot of different things now, but i still se no metrics in Cloudwatch I have the AWS keys in place and the proxy settings is working for s3 logging, when i uncomment the aws-s3-log-bucket-id, The transactor log is updates in s3 When i unkomment the datomic.lifecycle in logback.xml i se headbeat lines in the transactor log file, but not the metrics HeartbeatMsec format, regular log statements I set all aws and http logs levels to DEBUG and i can see a few lines in the log: com.amazonaws.metrics.AwsSdkMetrics - Admin mbean registered under


@drankard Datomic reports metrics to Cloudwatch under a separate namespace. At the bottom of the left navigation bar in the CloudWatch dashboard there is a pull down menu (Custom Metrics...). There should be a Datomic namespace there.


@drankard could you supply your transactor logs if that doesn’t do the trick?