This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-23
Channels
- # bangalore-clj (1)
- # beginners (23)
- # boot (90)
- # cljs-dev (133)
- # cljsrn (5)
- # clojure (104)
- # clojure-austin (1)
- # clojure-belgium (2)
- # clojure-dev (12)
- # clojure-gamedev (4)
- # clojure-italy (2)
- # clojure-russia (6)
- # clojure-spec (30)
- # clojure-uk (117)
- # clojurescript (197)
- # core-async (25)
- # cursive (9)
- # datomic (95)
- # devops (1)
- # dirac (49)
- # emacs (1)
- # hoplon (3)
- # immutant (10)
- # lein-figwheel (2)
- # luminus (5)
- # off-topic (43)
- # pedestal (1)
- # protorepl (1)
- # re-frame (13)
- # sql (5)
- # untangled (1)
We're looking at Datomic data modelling and have seen a bunch of different libraries that provide abstractions over raw Datomic schema syntax. Some are light syntax, some are full-on ORMs. This is our first Datomic project, so I'm leaning towards minimal layers on top of Datomic if any, but wondered what people with experience would recommend? https://github.com/vvvvalvalval/datofu https://github.com/Provisdom/spectomic https://github.com/nrakochy/schmad https://github.com/vvvvalvalval/onodrim
This might be heavier than what you’re looking for, but zcaudate’s Spirit library seems really cool, thought i’d throw it up for consideration: http://docs.caudate.me/spirit/spirit-datomic.html
@danielcompton i highly recommend you start with the Datomic api directly. those libs, as good as they are, were oriented towards whatever those people were building. using one of them shades your thinking with that direction, and also teaches you that API instead of Datomic’s own. after nearly 5 years with it, and several attempts to use abstractions like this, i can tell you that the Datomic API is incredibly well designed 🙂
recent changes in Datomic also removes the helper data that the transactor used to need when declaring schema, so it really is nice, clean, declarative data now. like Rich says, don’t be scared of a little typing, and you’ll be fine!
Thanks, that's what I suspected but good to hear it confirmed
The one thing I think we might use is https://github.com/cognitect-labs/vase/blob/master/docs/design.md#schema-tx-reader-literal
as that seems to cut down on the verbosity of the schemas
quite honestly, schema verbosity is a non-issue. it lives in your database. the code that puts it there is transitory. once done, you should be looking at your database for schema, not your code
robert-stuttaford: I have a different experience, verbosity has been an issue for us, and writing the schema in code has its benefits. On contrary, I've found it viable to think of the database as "catching up" with the code, not the other way around. My point being it's not obvious there's one right way to think about this 🙂
our team generates schema from code and, in my opinion, it has led to a number of pitfalls. (Our shortcomings could simply be attributed to us as a team of developers of course) I’ve noticed that we’ve ignored a lot of best practices when our model code doesn’t bend the right direction, like we’ll end up changing the semantics of attributes, essentially “reusing” a name. Recently our team started thinking about migrations as rollback or roll forward, which just completely blows my mind. I think if they weren’t looking at code that they edit in place, they’d be forced to have the right mental model.
you do need the discipline to avoid breaking changes with the "code as the source of truth" approach, but I think it's not too contraining with Datomic.
how do you guys handle synchronizing schema across local/staging/production environments?
@U0518FWJV periodic backups from production, plus forking locally
this becomes very apparent when you have multiple apps on a single database 🙂
@danielcompton you may find the Datomic console or https://github.com/Cognician/datomic-doc#search useful for inspecting your database over time
Nice I just saw that
Looks handy
What are downsides of embedded Datomic Datalog (local storage) vs SQL storage or others? What are differences?
for what environment, @kwladyka ? dev? production?
so, dev + transactor-local are really not for production settings: they co-locate the data with the transactor process. this loses you some of the benefits of Datomic’s deconstructed design; to scale either, you need to scale both — but having said that, it’s really not scalable for storage.
but, having said all that, i know some folks use it anyway. it all depends what your needs are 🙂
now i mainly still consider datomic free vs postgresql, i want do things like for example generate labels for label printer for orders in e-store etc. These are too small things to pay high price for datomic at that moment.
why not start with free, and switch when you feel it’s time to?
But the main problem is it wouldn’t be SaaS probably, so each client has to have own database and it makes it very costly.
ah, you’re speaking of distribution. you’ll want to check the EULA for that.
@marshall will be able to tell you
I think datomic free is fine for distribution
https://my.datomic.com/downloads/free “Datomic Free is suitable for open-source projects requiring distribution, but is limited to 2 simultaneous peers and transactor-local storage only.”
@danielcompton @robert-stuttaford I'm biased as the author of course, but with Datofu I've really attempted to be close to the metal without imposing any opinions or additional concept - the only things Datofu attempts to achieve regarding schema declaration are readability and concision without losing any expressive power. Having said that, I also recommend you start without any library and consider adding it when you feel things are becoming tedious.
@danielcompton Also, please don't use Onodrim yet, it's not even alpha-ready - apologies if I miscommunicated that in the README. I may have something usable by the end of this Summer.
@val_waeselynck starting bare was going to be my approach. Your recent blog post was helpful in redirecting my attention to Datomic and the new less restrictive licensing options makes it very appealing to use now. It would be cool to to see some information on why you would want to use something on top of bare Datomic and the problems they solve so newcomers have something to reference when they start hitting some friction. That and some best practices, perhaps in the form of another blog post hint hint 🙂
@naomarik you mean like this one? 🙂 http://vvvvalvalval.github.io/posts/2016-07-24-datomic-web-app-a-practical-guide.html
Maybe we need to improve the discoverability of such community resources. @marshall, maybe a new section on the Datomic website?
I'm constantly discovering awesome blog posts and gists that have been around for months
@robert-stuttaford what do you like to use to visualize or reckon about installed schema?
@uwo i built a thing over December to help with that https://github.com/Cognician/datomic-doc#search , which helps, but mostly i query the database at the repl 🙂
@robert-stuttaford thanks!
@matthewdaniel I cannot speak as to whether the code you posted should work, but I think if you just put the lookup refs in the values (instead of a map with :db/id) it will work. You can also just write {:vendor/number "..."} and rely on upsert behaviour
isn't :db/ident [:vendor/number "123] a lookup ref? the docs don't seem to have another option
i tried removing the db/id stuff and just writing vendor/number '..." but that doesn't work either
is there something i can do to get better error messages than "cognitect.anomalies "Server Error"
well i think i had 2 problems but my initial thing will work. I needed to put my transactions into a vector and I forgot to make vendor/number unique. Thanks for the pointers @val_waeselynck
Hi! I am completely new to Datomic and I have two quick questions: (1) I just read http://docs.datomic.com/backup.html but from what I understand Datomic can work on top of various datastores (postgres, dynamodb, etc). Would a backup of the underlying datastore suffice?
(2) if I run into issues using datomic, how responsive is the community? (I guess this question will answer itself 😄)
@hmaurer for support -- there are support contracts and there's also a lot of free resources in http://www.datomic.com/support.html
@hmaurer: 1. I've found the datomic backups to be super straightforward and painless so I've never tried just backing up the underlying storage (also the datomic backups don't take down your storage while they run in case that's an issue). 2. I've found the community to be responsive and friendly, if a little small. In addition to this channel, the mailing list is also worth checking: https://groups.google.com/forum/#!forum/datomic
Have you had to restore from backup after catastrophic failure @timgilbert ?
I think we did so one time and it went ok, I wasn't super involved with it though
It involves taking down all the transactors, which is unfortunate but makes some sense. The nice thing about having all the history in there is that the need to do it seems to come up a lot less (in my experience so far)
@timgilbert thank you!
I am trying to set up Datomic Starter locally (following the tutorial) but getting this error: https://gist.github.com/hmaurer/b9d303055c7a9b7c4e4827b5b79e2acc
had the same issue myself, you have to make sure you create the database before you connect the peer server to it
i found this helpful http://docs.datomic.com/dev-setup.html#sec-2
@matthewdaniel are you sure you had the same issue? this error seems to be about class loading, which create the database shouldn’t impact?
Trying this now. It’s strange, the instructions are quite different from the getting started guide
@matthewdaniel Everything works until I get to the “http://docs.datomic.com/dev-setup.html#peer-server” section
“Exception in thread “main” java.io.FileNotFoundException: Could not locate datomic/peer_server__init.class or datomic/peer_server.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.”
I didn’t realise there was a distinction between “datomic free” and “datomic starter”
The “Starter” edition is free, so after creating my account I went to the “Downloads” menu and downloaded the latest version
the file was called datomic-free but it didn’t attract my attention and it’s what I was expecting
> The primary use case for Free is not new users, but rather people who need a license that includes redistribution rights.