Fork me on GitHub
#datomic
<
2017-10-22
>
lmergen12:10:25

do i understand it correctly that datomics internal ids should typically not be used anywhere else in the application ? say that i have a bunch of objects which i want to uniquely identify, what's preventing me from using that id in other places in my application ?

lmergen12:10:51

(consider the case where i want to reuse datomic's id for a user id, for example)

lmergen12:10:01

what i'm planning on doing right now is to simply associate each user with a uuid (generated using squuid), and indexing that, but i'm not sure whether this is the best practice ?

potetm13:10:22

@lmergen I would highly recommend generating squuids for any entity you need to reference externally (e.g. that users interact with, that you have APIs for, etc). The upside is 1. you now have a globally unique id for an entity, which is good conceptually and 2. it enables certain things like decanting and sharding. The downside is a small storage and indexing cost.

lmergen13:10:43

yep, i figured as much

potetm13:10:25

Though datomic thankfully does the internal integer id itself.

lmergen14:10:14

yeah, i'm not against uuids, on the contrary

lmergen14:10:41

it's just that i was a bit uncertain about the intent here

mpenet14:10:47

make it app independent for extra points: ex URNs. Might be overkill but depending on the context it s quite nice when it s a fit