Fork me on GitHub

Hi datomic users - anyone have any tips on early stage data modelling for Datomic? I’d be interested in blog posts about 1) the early design phase of a project prior to creation or 2) tools to faciliate exploration or schema creation (like the codeq schema;X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20191023%2Fus-east-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20191023T131443Z&amp;X-Amz-Expires=300&amp;X-Amz-SignedHeaders=host&amp;X-Amz-Signature=51d040c7b4a25ac20cb3f81026f005b3b062f211d6fe22db2d1f17bfc54a3d9f)


we usually use Omnigraffle to make those datomic schema diagrams


the techniques here though are very similar to classical ER diagrams, with the distinction that Datomic is more flexible than your typical "tables" of ERD (attributes can be common across "entities", ref types refer to other entities directly, not via PK/FK, cardinality, components, etc)


most of that stuff can just be annotated on the diagram though. from a big picture you're still drawing tables and lines


Thanks @alexmiller. Do you have any suggestions on how to think about early stage data design - e.g. trade-offs around making your data model “flatter” or not. Or in your experience as you start modeling the data, a natural degree of partitioning begins to emerge.


in general, I find modeling with Datomic usually lets you be pretty close to a logical ERD and there is no reason not to break things out the way you like. you can think more "table"-like, but also do a mixture of graph-like things (and in my experience most enterprise apps are 85% "table"y and 15% "graph"y - Datomic gives you the best of both worlds)


it's definitely good to go as far as you can in diagrams before you ever write any code or schemas - changing diagrams is a lot faster :)


just tried to run Datomic Pro 0.9.5981 locally, using client-pro 0.8.28, and I’m running into this issue:


not running in Docker, and setting :validate-hostnames false in the client config doesn’t do anything it seems


upgrading client-pro to 0.9.37 fixed the issue