Fork me on GitHub

@wei - both :: definitely planning on open sourcing our stuff as well, when the time is right.


@harold have you found that datomic is sufficient for the volume of data you generate?


would there be any issues with creating enum entities dynamically (i.e. to reflect user additions)? I want to provide a hierarchical tagging system and think they'd be more useful than raw strings.


The one issue I can think of is that I'd have to manage them indirectly to e.g. handle "deletions"

Ben Kamphaus15:03:11

@curtosis: so for the first pass I’ll throw out the basic rule of thumb — if it’s something you’d type into your application code, that’s the best fit for an ident.

Ben Kamphaus15:03:27

for most other cases having a unique identifier and using lookup refs is the best approach.


hmm.. why is that?

Ben Kamphaus15:03:45

the point of ident is for its keyword name to be interchangeable in many contexts with its entity id. If you have to do partial matching on the stringified ident, or generate things on the fly, you’ll give up performance advantages that come from having the ident in memory.

Ben Kamphaus15:03:28

also ill suited for existence tests in query (error vs. no matches)


Also, if I recall correctly, all Idents are kept in memory, all of the time, on all Peers. If your users create millions of tags, that could lead to inefficient use of memory.


As far as convenience, Lookup Refs are almost as convenient as Idents.


(sorry, Internet decided to die on me. finally gave up and switched to iOS app.)


That makes sense. I don't think I expect anywhere near that many tags, but there doesn't seem to be much cost to just avoiding it in the first place. And there's indeed something to be said about not exposing program-internal language to the user.


as I understand it, I don't even really need to create a uuid attribute - the string name has to be unique anyway for lookup refs to work, right? So there'd be an entity with one attribute, which would be a name instead of a db.ident, right?

Ben Kamphaus16:03:56

right, in this case by “unique identifier” I meant to point towards a string (or potentially keyword) attribute with :db/unique :db.unique/identity rather than suggest a uuid valued field.

Ben Kamphaus16:03:27

for tags or something similar, unique string makes sense. Whether or not it makes sense to model it as an entity is a separate question, it looks like given the hierarchy of tags you expect, the entity with an attribute for a name and other attribute(s) for relations to other tags makes sense.


good, I'm following. :) And in fact I do have it modeled as an entity, precisely because I also want a :tag/parent ref attribute.


rereading the page on identity and uniqueness, it's all laid out pretty nicely - the key bit here is that my "enumerated tags" usage is not programmatic, so the semantics should be different (as are the tradeoffs). got it, thanks!


When a peer upgrades its Datomic version, must the transactor that it connects to also be on the exact same version? If not, how do you know when to upgrade both the peer and transactor, as opposed to just the peer?

Ben Kamphaus17:03:19

@sdegutis: don’t need to match versions except across compatibility breaking changes (all documented here: ) — recommendations for upgrading an entire live system are here:


@bkamphaus: Excellent, thanks very much.


how would you use get-else where the non-default value is not the value that would be missing? This doesn't do it:

(d/q '[:find ?label ?parent 
       :in $ 
       [?t :tag/label ?label]
       [?t :tag/parent ?r]
       [(get-else $ ?r :tag/label "N/A") ?parent]] (d/db conn))


hmm... maybe get-else isn't the right tool here. I got it to do what I expect using an or-join, but it looks a little ugly:

[:find ?label ?parent 
       :in $ 
       [?t :tag/label ?llabel]
       (or-join [?label ?parent ?t] 
                (and [(missing? $ ?t :tag/parent)]
                     [(ground "N/A") ?parent])
                (and [?t :tag/parent ?r]
                     [?r :tag/label ?parent]))]


I suppose that's not actually terrible, but perhaps there's a simpler way.