Fork me on GitHub

@bkamphaus: thanks, it hadn't occurred to me that component was treated as a technical term before the above two posts. Forgive my mediocrity.


@bkamphaus Does d/with work on as-of db values ?


Can I add a nil attribute value with the map form and expect it not to be asserted at all while the rest of the attributes are?

{:db/id (d/tempid :db.part/user)
 :order/status (get-status)}
;; get-status might return nil


no. you need to exclude it from your transaction


thanks robert


(let [s (get-status)] (cond-> {:db/id (d/tempid :db.part/user)} s (assoc :order/status s)))


you probably aren't doing this, but you can't assert {:db/id ...} without at least one attr along with it


yeah i have a bunch of them


so I'm not the sole inventor of the (cond-> m x (assoc :x x)) pattern. bummer


-grin- use the hell out of that pattern


@greywolve: I did an experiment over the weekend using d/with on as-of dbs, and I haven't seen any issues, fwiw

Ben Kamphaus15:08:02

I’ll have to defer to @marshall or @jaret re: anything changing with that behavior, but last I was aware with prospective transactions don’t change what an as-of database will find/retrieve with query, datoms, etc. - the with transaction is filtered out of the as-of db.


@jaret I saw that, and I was under the impression that that thread applies to doing the reverse


Thanks all 🙂


(d/as-of (d/with …)) does lead to unexpected results


(if you're expecting your d/with stuff to show)


speculative branching (i.e. with) is only allowed on the “current” DB as-of is a filter, so I wouldn’t recommend doing either


Hi, I think I am understanding something wrong in the CORS option of REST APi. Isn’t it the way to specifying all origins allowed, eg, bin/rest -p 8001 -o /'*'/ ddb datomic:<ddb://us-east-1/nameofdynamodatabase>


When you retract an entity related to an isComponent attribute, is the history for that entity lost? I can’t find some of them even with (d/as-of db tx).


Oh. Hm. If a given TX has retracted an attribute, you have to use an earlier “value of the database” to find out what it was.


If that history datom indicates the attribute was “deleted”, then decrement the TX and run the query with the as-of db to find out what it pointed to. Seems to work.

Chris Bidler18:08:30

operational question: if you have a transactor running in EC2 and you want to schedule backups of the db, is the best practice to have a separate EC2 instance (or a Lambda function or what have you) with a separate Datomic install and a crontab? My initial thought was to add an /etc/cron.d entry in the CF template but my stumbling block is the fact that the actual install location of …/bin/datomic is not easily found

Chris Bidler18:08:41

which makes me suspect that I’m not supposed to use it for anything. 🙂


IMO better to use a separate instance. We use our jenkins for that


@chris_johnson we use a separate t2.medium which runs hourly. i haven't yet figured out how to make it run backups in a loop (start again as soon as you're done). it's NOT recommended to run backups on your transactor machine because of the CPU hit


backups run from storage directly, no need for transactor involvement!

Chris Bidler18:08:35

right, I was thinking since we don’t (yet) have anything running but transactors, and since I’m about to push a version update, maybe we could throw the cron job on the machine we have

Chris Bidler18:08:01

but I actually reached the same conclusion as you as soon as I read “please give backup as much memory as your transactor usually gets"

Chris Bidler18:08:29

our data is small and backups that have been done by hand are pretty snappy, I think I’m going to try doing it in a Lambda function


yeah, not a good idea. too much of a disturbance to transactor process. of course, we did exactly this for the first 18 months, when we ran a snowflake server with transactor, postgres, memcached, backups, and rabbitmq all on one instance 😄

Chris Bidler18:08:38

I will let you know how it goes

Ben Kamphaus19:08:21

I’ll just echo the recommendation to use separate instance and have it backup in a loop or at regular (frequent) time intervals.