This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-10
Channels
- # aleph (2)
- # arachne (1)
- # beginners (5)
- # boot (33)
- # cider (12)
- # cljs-dev (6)
- # cljsrn (26)
- # clojure (33)
- # clojure-austin (7)
- # clojure-belgium (6)
- # clojure-chicago (1)
- # clojure-dusseldorf (1)
- # clojure-fr (1)
- # clojure-hamburg (1)
- # clojure-nl (11)
- # clojure-portugal (3)
- # clojure-russia (14)
- # clojure-spec (35)
- # clojure-uk (28)
- # clojurescript (49)
- # component (7)
- # core-async (75)
- # cursive (13)
- # datomic (15)
- # dirac (57)
- # emacs (5)
- # events (1)
- # hoplon (34)
- # jobs (2)
- # jobs-discuss (8)
- # lambdaisland (1)
- # lein-figwheel (7)
- # leiningen (3)
- # om (5)
- # onyx (8)
- # re-frame (56)
- # reagent (13)
- # testing (7)
- # untangled (30)
- # vim (51)
- # yada (17)
published a guide to help get started building Datomic apps: http://vvvvalvalval.github.io/posts/2016-07-24-datomic-web-app-a-practical-guide.html
What's the best practice for handeling concurrent changes to an entity in Datomic? For example, if both user A and user B retrieve entity X with transaction id 1 and then user A changes attribute X1 and user B changes attribute X2 and then user A updates the entity with transaction id 2, followed by user B updates the entity with transaction id 3. If the client, by convenience, wants to send all the attributes for the entity to the transactor, how can we make sure that user B doesn't overwrite user A's changes? Our idea is to pass the transaction id with the entity to the client and back again so that the server can do a diff with that transaction and only update the changed attributes. Is there a better approach?
@teng :db.fn/cas
@teng if you have no automated way of resolving conflicts, there's a transaction function :db.fn/cas
(compare-and-set) which would cause one of the updates (in your case B) to fail. To minimize the risk, I suggest you perform of diff
@robert-stuttaford you beat me to it 🙂
Thanks!
If I'm using DynamoDB for storage and a datomic transaction completes, is the data already in DynamoDB or is there a period where it's on local disk? Is it safe to destroy the transactor machine and disk immediately when the transaction completes without losing data?
@bmays @djjolicoeur Because of the caching and local execution of query, nested query and/or sequential query are both good options that don’t pay the same kind of penalty sequential query might pay in a more traditional client/server RDB
@yonatanel When a transaction completes successfully the data are guaranteed to be written to durable storage (whatever your backend is) in the log
@yonatanel if your transactor dies immediately after a transaction completes your data will not be lost.
@hueyp you always have reverse lookups on any ref: http://docs.datomic.com/pull.html#reverse-lookup