This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-13
Channels
- # bangalore-clj (1)
- # beginners (40)
- # boot (22)
- # clara (19)
- # cljs-dev (265)
- # clojure (160)
- # clojure-dev (6)
- # clojure-italy (5)
- # clojure-russia (47)
- # clojure-spec (10)
- # clojure-uk (63)
- # clojurescript (88)
- # core-async (8)
- # cursive (54)
- # datomic (48)
- # emacs (32)
- # garden (3)
- # graphql (29)
- # hoplon (54)
- # jobs (1)
- # klipse (4)
- # luminus (5)
- # lumo (21)
- # mount (5)
- # off-topic (16)
- # om (2)
- # pedestal (10)
- # play-clj (1)
- # portkey (32)
- # re-frame (21)
- # reagent (48)
- # rum (1)
- # spacemacs (4)
- # sql (3)
- # unrepl (5)
Every question about datomic that I google, I arrive in a @val_waeselynck's github repo https://github.com/vvvvalvalval/datalog-rules
Sounds like a new law. Similar to how you eventually end up on Wikipedia’s “Philosophy” page if you keep following the first link of every Wikipedia article
@U2J4FRT2T and do you find the answer there? :)
I probably do not understand in what way is datomic consistent, as I find the description at http://docs.datomic.com/acid.html#sec-2 well, cryptic. Is it simple enough to explain the consistency model of datomic in few lines of plain English? or would you recommend some other resource for it?
I think the key to my understanding would be answering ― > How is a peer's time basis managed by datomic?
Conceptually, if all peers need to have the same consistent view of the database, then either all peers have to synchronize with some network element before arriving at that consistent view, or something out of the box governs the peer nodes seeing the same consistent view of the data (?!)
I would like to learn what kind of "consistency" does datomic guarantee, and also, at a high level how is it internally accomplished
@matan For writes, Datomic is serializable. For reads, the system that constitutes a set of peers (viewed as a database server) can have various degrees of consistency and/or availability based on your own decisions
For instance, if you use datomic.api/sync, you can always read your writes
if not, you may have stale reads
(speaking under control of the cognitect guys of course)
I'm not sure I see how this translates to being consistent. It's easy to see that writes can be consistent, if at all a sentence like this isn't by definition void. I'm still stumped by the notion of consistency there.
@matan well in the sense of the CAP theorem, consistent means linearizable, and a set of peers + a transactor behind a load balancer is typically not linearizable when implemented in the most naive way, since they allow for stale reads (updates are pushed asynchronously to peers, and peers remain available in case of a network partition which separates them from the transactor)
Now, interestingly, you can return the new t to the client after each write and read, and call d/sync for each read, which I believe makes the system closer to CP
so the client is kind of in control of consistency here
Again, not an expert at all, so take what I say with a grain of salt 🙂
apologies for the newbie question, still wrapping my head around datomic:
if you have an attribute that’s a ref to multiple entities, is there a way to enforce order? if not, how do people usually get around that?
as a practical example, let’s say I’m making a recipe app. I have a recipe
entity which has a ref with cardinality/many
to possibly multiple recipe-step
entities, each of which may be edited/updated at any time
would I want to put a recipe-step/step-number
attribute on that entity and sort that way? any other idiomatic ideas?
You can add an “index” attribute to your entities, or store your data as a linked-list
interesting. any intuition on if there’s a way to ease the pain of updating each affected step-number
attribute as steps are inserted or removed?
obv if I have a list of 1-10 and step 2 gets removed, I can just update 3-10 to have a different value for that step-number
attribute. just wondering if there’s a more idiomatic/convenient way
that example is pretty simple, but doing that on a collection of 10k elements seems painful
if it's important for you to renumber as few as possible, you can renumber from the insertion point to the top of the list (decrementing as you go)
i.e. with list [0 a 1 c 2 d], inserting b between a and c, it touches less to do [-1 a 0 b 1 c 2 d]