datomic

Ask questions on the official Q&A site at https://ask.datomic.com!
kennytilton 2020-08-31T00:00:19.136200Z

As a noob, ident had my head spinning because everywhere I looked in Datomic I saw IDs. And dto is similar to allegrograph which I grok OK so it is not even alien technology. I guess idents are closest to enum in programmerspeak; they let us give a number a mnemonic (another term I would consider, along with alias). But wait, we are in the Land of Hickey, what does the dictionary say? "name noun 1. a word by which a thing is known, addressed, or referred to." Lovely. Btw, I do not like identifier because the entity-id is an identifier, and the real one needing no translation. Fun stuff. 🙂

2020-08-31T00:18:08.136400Z

Yep. it takes time to learn the language 🙂.

val_waeselynck 2020-08-31T00:29:38.139200Z

I would be very surprised if it did 🙂 that said, it probably keeps a cache of compiled Datalog queries somewhere in the JVM.

val_waeselynck 2020-08-31T00:31:41.139400Z

Datomic has a philosophy of "I'm not slowing down because you're watching me", it seems to me that logging every query would go against that philosophy, especially given the aim that most queries be fast walks through in-memory data structures.

2020-08-31T00:37:40.139600Z

seems reasonable. Having that log isn't a goal of mine, if it existed it might be useful though. I'm considering how to extend the datalog language so it could be used across multiple databases. I have no real plans on doing this, just a thought experiment.

favila 2020-08-31T01:10:15.140400Z

It can already do this?

favila 2020-08-31T01:14:04.144300Z

Not sure if you are thinking exactly of this, but you can already supply multiple data sources, :in $ds1 $ds2 then reference in pattern clauses by [$ds1 e-match a-match ...] or in rules by ($ds1 rulename ...)

favila 2020-08-31T01:15:22.145900Z

Not having to mention the default $ name most of the time is syntax sugar

favila 2020-08-31T01:23:35.153500Z

Idents have enough unique properties viz entity ids that it’s worth giving them another name imo. Entity id values are not user-controllable, are not a public contract, and should not be stored durably for long periods outside the system. Idents are all of these, and are also reassignable and guaranteed unique. You can maybe think of them as a special case of lookup ref where the :db/ident attr is implied, although historically lookup refs came later

favila 2020-08-31T01:28:56.154700Z

This May be helpful as a primer on the kinds of “identifying” datomic has: https://docs.datomic.com/on-prem/identity.html

favila 2020-08-31T01:32:01.156700Z

An impl note: at least on on-prem there is a full in-memory map of idents to eids and vice versa, so they are faster forms of reference than normal unique attributes and that is also why you shouldn’t have very large numbers of them

favila 2020-08-31T01:35:53.158700Z

Idents are also valid even after retracted. This is so you can rename an attribute without breaking code—the old name will still work

kennytilton 2020-08-31T02:55:15.159200Z

Thx! I had indeed seen all that. I had not picked up, tho, that idents would work if stored outside the system even when entity-ids had changed. Interesting. But in that same section we see the sentence that actually, I recall, made me stop reading and look for a different tutorial:

When an entity has an ident, you can use that ident in place of the numeric identifier, e.g.
Thy syllables "id" and "ent" are doing the flight of the bumblebees in there. 🐝 The sentence before it was better. A little. The first half was fine. then it got weird.
Idents associate a programmatic name (a keyword) with an entity id, by setting a value for the :db/ident attribute
That's great like NYC street signs are great if we already know where we are going. But yeah, "name" by itself would have its own challenges. I will close by noting that, if a db/ident is a name for an entity, then per Gertrude Stein:
The :db/ident of :db/ident is :db/ident.
I'd give that a 10.

v 2020-08-31T03:12:37.161100Z

There is a really good video on this by folks at nubank. I believe it’s called 4 super powers of Datomic, where they talk about querying across multiple database. Highly recommended

souenzzo 2020-08-31T14:19:00.166900Z

Who do I get a older version of datomic dev-tools ??? My project uses com.datomic/dev-local {:mvn/version "0.9.184"} and I can't find how to download it.

souenzzo 2020-09-01T14:27:42.173Z

@stuarthalloway bit off but which maven repository do you use/recommend for small corps//personal experimentation?

stuarthalloway 2020-09-01T19:47:56.177Z

I tend to use an S3 bucket -- a maven repo is just a convention about files.

stuarthalloway 2020-08-31T19:16:33.168600Z

I will look into that -- in the meantime, can you just update the dep to latest. They are all compatible.

👍 1