Fork me on GitHub
#datomic
<
2019-05-24
>
steveb8n00:05:47

Q: I have a micro-service in another VPC that I want to reach from an Ion. I was assuming that I need to use VPC peering for this but the new video seems to suggest that a VPC link might also work. Does anyone have any advice about this?

ghadi00:05:57

the micro-service in the other VPC is not an Ion, right? @steveb8n

ghadi00:05:19

actually the answer doesn't matter

ghadi00:05:25

You want to peer the VPCs

ghadi00:05:48

ensure both VPCs do not share the same address space

steveb8n00:05:51

yep, the microservice is Fargate with an ALB

steveb8n00:05:04

ok, thanks. I’ll stick with peering

ghadi00:05:13

that's the simplest solution

steveb8n00:05:33

I am simple. That works for me 🙂

akiel14:05:58

Is there a possibility to travel the history from recent to past? If I use the following, I get the oldest datoms first:

(d/datoms (d/history (d/db conn)) :eavt eid :version)
I have a :version attribute on each entity which is incremented on each change.

souenzzo14:05:57

@akiel you can query the history

akiel15:05:02

Yes, but a query returns a set or a vector which is unordered. That’s even worse, there I have to sort the result.

akiel15:05:55

I like to get the n newest transactions on a particular entity in an efficient way.

Ivar Refsdal09:05:26

Not sure if this is efficient, but how about something like:

(d/q '[:find ?vv ?tx
       :in $hist $curr ?ref ?n
       :where
       [$curr ?e :e/ref ?ref]
       [$curr ?e :e/version ?v]
       [$hist ?e :e/version ?vv ?tx true]
       [(- ?v ?n) ?vmin]
       [(> ?vv ?vmin)]]
     (d/history db)
     db
     "my-ref"
     10)