Fork me on GitHub
#datomic
<
2022-10-26
>
pppaul14:10:45

is it possible to add :db/unique :db.unique/identity to a schema that's already in the DB? when i do i get errors related to index

favila14:10:56

if you are on on-prem and the attribute does not have a value index yet, you need to add one first so it can verify uniqness

favila14:10:12

cloud has a value-index on everything already

favila14:10:26

yes. Note this section https://docs.datomic.com/on-prem/schema/schema-change.html#altering-attribute-to-unique > In order to add a unique constraint to an attribute, Datomic must already be maintaining an AVET index on the attribute, or the attribute must have never had any values asserted. Furthemore, if there are values present for that attribute, they must be unique in the set of current assertions. If either of these constraints are not met, the alteration will not be accepted and the transaction will fail.

favila14:10:50

(I”m assuming through all of this that you are using on-prem--if you are using cloud you may have a different problem)

pppaul14:10:51

i'm on prem

thumbnail14:10:54

Is it possible to fetch just the datomic-transactor-pro-<version>.jar from my.datomic ?

thumbnail14:10:08

for reference, for datomic-pro (and the other deps) this just works: wget --http-user=$DATOMIC_REPO_USER --http-password=$DATOMIC_REPO_PASS

thumbnail14:10:15

context: we need to bump the postgresql adapter to something recent so we can use modern password strategies (iirc). We run datomic on Nomad (i.e. in a docker container) and built our own. We need to include some jars in the installation anyway for prometheus metrics and custom database functions. currently we fetch a datomic installation, manually fetch a bunch of jars to update and replace them in ./lib. We figured we could just write a pom.xml to ‘bump’ the postgres dependencies and include our own, and simply switch to jib to built the Dockerfile. But we hit a snag here because we can’t actually fetch the datomic-transctor-pro jar.

favila14:10:57

how can you confidently write a pom.xml that accurately reflects everything a datomic transactor needs?

favila15:10:22

IMO patching lib is the only safe thing to do

favila15:10:42

(It’s what we do, then we stash the updated zip on s3)

favila15:10:39

and this is even being 90% sure that most of the bytes in lib are just transient-deps of requiring the entire aws sdk and are not used.

thumbnail15:10:25

I figured id use the pom that comes with the transactor 😅, its bundled

thumbnail15:10:58

And refer to it in my own pom, using managed deps to make sure i get the deps i want

favila15:10:59

Are you referring to the pom.xml in the root of the zip? That appears to be for the client (note the artifactId).

thumbnail17:10:37

The pom inside the transactor-jar (under meta INF)

thumbnail17:10:26

I just hoped it would be available to pull from my.datomic 😁, orherwise well have to do the unpacking and lib patching, but it started to grow too big for my liking,

Daniel Jomphe18:10:05

Hi Cognitect, we might have found a disparity between Client API's pull and dev-local's pull.

(d/pull db '[*] nil)   ; eid arg is nil, what happens next?
• dev-local's pull accepts a nil eid and makes this pull return nil. • cloud's pull raises an exception about the nil eid. Might we have a dev-local behavior identical to the cloud for this, please?

Daniel Jomphe18:10:43

Now, I'm sure Cognitect will tell me I forgot something obvious... 😬

ghadi19:10:50

I think this is worth raising in the official forum

ghadi19:10:01

ask, I think

1
😁 1
Daniel Jomphe19:10:24

Sorry, I felt the need to put a bit of humour into your day. 😆

1
enn19:10:20

I think there is a mistake in this documentation: https://docs.datomic.com/on-prem/overview/architecture.html. The bullet points under the “Peer Server” and “Transactor” headings are identical (I believe they describe transactors, not peer servers.)

👍 1
👀 1
jaret19:10:56

I think I see what we did there. An org mode error. The section is missing the following bullet points:

The ${Peer} server is a JVM process that provides an interface for the Datomic Client library.

- Accepts queries and ${transaction}s from Datomic Clients
- Submits transactions to, and accepts changes from, the ${transactor}
- Provides data access, caching, and ${query} capability to connected Clients, reading from the ${storage service} as needed

jaret19:10:13

I will get this updated once I untangle how it happened.

jaret19:10:24

Thank you for the report!

frankitox20:10:28

Can I use the same memchached node (ElastiCache) for the transactor and a peer?

Joe Lane20:10:40

Yup 👍

😁 1
jaret23:10:34

I saw your first question before you deleted it. I just wanted to add that while there is currently no way (api or other tooling) to heat up a new cache you can use a shared memcached for transactor and multiple peers. This pattern enables new peers to have some relevant information ready in the shared cache. Particularly useful if you have a dedicated peer walking the indexes or a reporting type peer process that might touch all data. I am happy to answer more questions about caching in Datomic if you have a need. <mailto:[email protected]|[email protected]> or DM me.

👍 1