Fork me on GitHub
#datomic
<
2019-02-03
>
Brian Abbott00:02:17

Glad I found this channel

Brian Abbott00:02:29

I have a lot of questions RE Datomic

Ian Fernandez02:02:15

guys, Google Cloud has a Datomic instance?

hmaurer16:02:26

You could run it by yourself on google cloud, but it will have to be datomic on-prem, that you manage, and not datomic cloud

johanatan05:02:54

so, in other words, if i were to map over transaction IDs and do the query as-of each of them, 99.9% would be duplicate values for any particular entity X, related entity Y and attr A (because each transaction changes only a single entity typically).

johanatan05:02:01

so another solution to this would be to "de-dup" the transaction IDs for a particular entity X and related entity Y before doing the queries and then do the as-of queries for each transaction ID actually involving a change to entity X or entity Y.

favila23:02:33

Or you could return the tx id from the query and pull later

favila23:02:06

Or you could create an as-of db and use it as an argument to a sub query

favila23:02:23

Could you be more concrete about the desired input and output you want? Tx is available to datalog so with some range filtering you can do some things in one query, but I don’t know if it’s worth it without a more specific problem

johanatan22:02:46

Well the bigger problem is the sheer # of transactions that would be irrelevant. I need to find a list of txids where let’s say a particular entity (or any of its related entities) actually changed value. Then it is straightforward to do the query I care about only at those transition points. It would be infeasible to run this query on every txid.

johanatan19:02:48

@U09R86PA4 ^^

favila23:02:20

[?e ?a ?v ?tx ?added] clauses don't look at every tx, only those which involve ?e ?a ?v. I think you need a concrete example (some code) to suggest something more concrete

favila23:02:54

it could be that you can't do what you want efficiently, but we're talking too abstractly for me to say for sure

favila23:02:22

maybe you could make a stackoverflow question?

johanatan21:02:57

yea, honestly i didn't really understand [?e ?a ?v ?tx ?added] clauses. where can I find more information on that?

johanatan21:02:24

also, i can create a concrete example if I explore the provided material and still have an open issue.

johanatan21:02:32

but it does sound like my answer will lie in understanding that clause.

favila21:02:43

datomic is datoms

favila21:02:51

datoms are a tuple: [entity-id attribute-id value tx-id assert-or-retract-bool]

favila21:02:12

datalog clauses are datom pattern matches

favila21:02:38

this may help:

favila21:02:50

the maps are an illusion

favila21:02:00

it's datoms at the bottom

favila21:02:21

and "time travel" is filtering datoms by tx

johanatan05:02:46

one question: for a typical clause [?e :some/attribute ?some-value]: is this just a truncated form of the [?e ?a ?v ?tx ?added] clause? i.e., are ?tx and ?added optional? also what exactly does ?added mean, is it true for only the single point in time where an association is originally made?

johanatan05:02:52

[and false at all other times]

favila13:02:41

Omission is truncation

favila13:02:08

Ie match anything

favila13:02:04

Added is true when the datom is asserted, false when retracted

favila13:02:55

You will only see “false” in history dbs.

johanatan17:02:41

👍:skin-tone-2:

adamfeldman15:02:20

@d.ian.b On Google Cloud, you can run Datomic On-prem yourself, and I believe you may use a managed service like Google Cloud SQL as the backing store. But yes, no Datomic Cloud on GCP, that product is tightly built around AWS services