Fork me on GitHub
#datomic
<
2017-11-10
>
csm00:11:38

so, we’re seeing an issue on startup of our services that use the peer library, connecting to dynamodb; we get constant {:event :kv-cluster/retry, :StorageGetBackoffMsec 0, :attempts 0, :max-retries 9, :cause "java.net.SocketTimeoutException", :pid 3955, :tid 55}, and the service never seems to connect properly

timovanderkamp13:11:43

Im trying to add data in datomic 'in the past' for testing purposes but whenever i try to set the :db/txInstant attribute i get this error: IllegalArgumentExceptionInfo :db.error/past-tx-instant Time conflict: Tue Oct 03 00:00:00 CEST 2017 is older than database basis Is there any way to force this or change the database creation date.

hmaurer13:11:21

@timovanderkamp afaik Datomic forces txInstant to be increasing

hmaurer13:11:48

the database basis is the timestamp of the latest transaction I think

timovanderkamp13:11:36

@hmaurer So that means my schemas must be timestamped in the past aswell?

hmaurer13:11:06

@timovanderkamp how so? sorry, I don’t understand the question

timovanderkamp13:11:03

If the schema's are installed at this time, i wont be able to add transactions in the past right

hmaurer13:11:39

in which scenario would you want to transact things “in the past” with an altered txInstant?

timovanderkamp13:11:24

I want to create reports for some entities, with information about certain moments in time

hmaurer13:11:01

Specifically the section “Taking a step back: event time vs recording time”

timovanderkamp13:11:14

Alright thanks!

hmaurer13:11:48

But as a quick TL;DR;, you shouldn’t be using :txInstant as the time at which your events occurred; only as the time at which they were recorded

hmaurer13:11:22

otherwise you run into issues, as you mentioned, where you might want to add events that occurred “in the past”, and Datomic will stop you from doing it

hmaurer13:11:41

From my (limited) understanding of the topic, it’s an issue you would stumble upon when building pretty much any event-sourced system. I think it’s sometimes referred to as “bitemporal data”

misha17:11:02

greetings! Is there anything worthy to read about storing localized names in datomic? Schema approaches, etc.

val_waeselynck08:11:48

I'm doing it by storing json-encoded maps in a string field.

misha10:11:53

do you store that map in the "name" attribute? or in a separate attribute?

misha11:11:18

Basically every time you pull an entity, you pull all the translations no matter what, right? But, with a convenience of not complicating any queries with a locale/language info?

val_waeselynck19:11:43

Yeah, that worked for me because any content had on a few locales defined, and only the UI dealt with localization. If that were not the case, I guess I would have used an entity with one attribute per locale; not very generic, but seems like a reasonable tradeoff for performance.

misha20:11:11

@U05120CBV was asking about this ^^^ sort of thing

misha17:11:35

or at least a checklist of things to consider while building brand new bicycle

rauh19:11:04

Just rewrote my db function to assert exactly the refs (or values) of a cardinality many: https://gist.github.com/rauhs/0704f6492674ea79e935a9e01ac3a483

rauh19:11:05

It's pretty flexible and works with tempid, refs, idents and most importantly also works when you do NOT necessarily know if what you're inserting is new or existing.