Fork me on GitHub
#datomic
<
2018-01-15
>
mkvlr10:01:19

hey 👋 for syncing between dev/staging/production we’d like to store external db/id attributes in datomic, is there a best-practice we should follow as how to name those attributes? Anything besides http://docs.datomic.com/best-practices.html#unique-ids-for-external-keys

chrisblom10:01:47

i'd avoid sharing :db/id's across databases

mkvlr10:01:17

I guess it’s a similar problem as when sharding datomic or linking to other dbs

laujensen13:01:28

I seem to have choked datomic. I added an index to a single attribute, and shortly after datomic killed MySQL. Now when I relaunch everything, MySql says “Got an error reading communication packets” and datomic says “Indexing retry limit exceeded”. All values a tweaked, max_allowed_package set to 1024M, log file size increased, etc. What could be causing this?

Drew Verlee16:01:57

What is the methodology & tools around restricting the state of the data in datomic. Also, on a more theortical level, when does it make sense to use such restrictions? Should you avoid business logic? In my current db we have triggers like “these db values can’t share the same name”. They tend to cause confusion because its not clear when your writing a db function what triggers you might violate and so its possible to get uncaught exceptions that result in 500's.

val_waeselynck17:01:19

@U0DJ4T5U1 I suggest you ask this on SO - I will provide an answer but I think it's better if others can find it

val_waeselynck17:01:57

Maybe a good title would be "How to prevent transactions from violating application invariants in Datomic"

Drew Verlee17:01:43

I'll look to the question when I get the chance, might be an hour or so

Drew Verlee18:01:57

Could you answer the part about how to use such restrictions in slack? That part is probably opinionated the factual and so might not go well over with SO’s guidelines.

Drew Verlee18:01:11

I dont think there is anything inherently wrong about constraints. But ideally there would be a way to know when you could possible violate one, so you could handle it. I think some sort of contract (type, spec) might be able to help with that. e.g your query can return the desired result OR possible data about one of these constrain violation.

Drew Verlee18:01:26

that way callers would know they need to possibly handle.

val_waeselynck19:01:36

@U0DJ4T5U1 I have not understood what part you want to discuss in Slack however.