This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-29
Channels
- # babashka (64)
- # beginners (60)
- # calva (10)
- # circleci (3)
- # clj-kondo (62)
- # cljdoc (6)
- # clojars (2)
- # clojure (152)
- # clojure-europe (19)
- # clojure-nl (3)
- # clojure-uk (18)
- # clojurescript (50)
- # clojureverse-ops (12)
- # core-async (21)
- # cursive (6)
- # data-science (1)
- # datomic (17)
- # events (14)
- # fulcro (64)
- # graalvm (20)
- # graphql (5)
- # honeysql (14)
- # jackdaw (3)
- # jobs (1)
- # jobs-discuss (22)
- # kaocha (2)
- # lsp (9)
- # luminus (8)
- # malli (30)
- # meander (31)
- # other-languages (1)
- # polylith (8)
- # re-frame (15)
- # shadow-cljs (85)
- # specter (2)
- # sql (11)
- # tools-deps (56)
- # vim (39)
- # vscode (7)
- # xtdb (16)
How do I use Datomic on gcp?
I suppose you have to run Datomic On-prem https://www.datomic.com/on-prem.html
I want to run it on a gke pod
what is the difference between transact and transact-async when I get similar timings on the same list of txs
(time (d/transact (conn) txs)) ;; 8369 ms
(time (d/transact-async (conn) txs)) ;;8455 ms
10k, in a in-memory db.
And what is the timing if you run:
(let [conn (conn)]
(time (d/transact conn txs))
(time (d/transact-async conn txs)))
"Elapsed time: 8887.066625 msecs"
"Elapsed time: 8879.807292 msecs"
d/transact derefs the future with a system-property-controlled timeout, then returns the future. It throws if the timeout is reached before the future resolves. d/transact-async returns the future without waiting, and lets you control deref and timeout.
what you are seeing is maybe the memory db doesn’t actually do work in another thread.
IMO d/transact should only be for convenience in the repl; d/transact-async should be in production code.
Makes sense. I just tested it with a remote db and I get
"Elapsed time: 125.154958 msecs"
"Elapsed time: 0.808292 msecs"
for 5 txs
Thank you :thumbsup:
note that you should always deref the result of d/transact-async. That’s the only way you will know if the transaction succeeded or not
I wish there was a callback we could attach to it. I guess there is no way other than to maintain our threadpool of blocking threads to deref those async txs