Fork me on GitHub
#datomic
<
2021-07-06
>
zendevil.eth09:07:18

I have created a peer connection with my local datomic server like so:

(def db-uri "datomic:")

(def conn
  "Get shared connection."
  (d/connect db-uri))
I want to create this connection on datomic cloud aws without changing the code so that the deployment has the right connection string based on whether it’s in dev or prod. Is there a connection string that I can get for datomic cloud? Ideally I want three uri’s: one for local development, one on cloud for staging and one for production.

helios10:07:15

In this page (https://docs.datomic.com/on-prem/schema/identity.html#idents) there is this explicit quote: > Idents should not be used as unique names or ids on ordinary domain entities. Such entity names should be implemented with a domain-specific attribute that is a unique identity. Can anyone help me understand why? I was thinking of having a single top-level entity defined as {:db/ident :system/settings} , so that i can do (datomic/entity db :system/settings) but it seems discouraged. Why?

favila11:07:43

1) different things are different 2a) idents are in a special cache/projection that is always fully realized in memory on all db objects so that attribute is resolution is really fast. Because of this you don’t want too many idents. 2b) this projection is a-historical: it doesn’t care about retractions only assertions. This is so renamed attrs can still be looked up under the old name. So this is yet another reason you shouldn’t use idents: they still resolve after retraction, which is probably not what you want for a domain entity

👍 4
favila11:07:43

Bottom line: idents are designed for the special needs of attribute names and lookups, not for domain entities

mkvlr10:07:13

I can think of two reasons: maybe because idents are entities and it would lead to the peer keeping the complete entity in memory? Or to not complect domain entities with them?

mkvlr10:07:07

but also curious to learn what the correct answer is 😼

zendevil.eth11:07:38

I’m doing lein uberjar, and it’s just stuck on compiling. How do I fix this?

indy14:07:17

The usual case is that your app probably has some def that spawns something like a http client. A thread that is never terminated.

souenzzo11:07:54

you are doing a top-level (def conn (d/connect ...)) or (def client (d/client ...)) Probably you will need to use (def *conn (delay (d/connect ...)))