This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-25
Channels
- # announcements (22)
- # babashka (9)
- # beginners (33)
- # biff (12)
- # calva (17)
- # cider (64)
- # cljdoc (3)
- # cljfx (16)
- # clojure (125)
- # clojure-bay-area (14)
- # clojure-europe (15)
- # clojure-norway (64)
- # clojure-uk (2)
- # clojurescript (7)
- # conjure (1)
- # core-async (4)
- # cursive (6)
- # data-science (14)
- # datahike (8)
- # datomic (6)
- # defnpodcast (4)
- # emacs (5)
- # events (1)
- # hyperfiddle (15)
- # leiningen (17)
- # lsp (8)
- # membrane (27)
- # off-topic (25)
- # podcasts-discuss (4)
- # polylith (6)
- # portal (21)
- # reagent (11)
- # releases (1)
- # shadow-cljs (36)
- # slack-help (2)
- # sql (1)
- # squint (131)
- # testing (12)
- # xtdb (7)
I was experimenting with Distributed configuration. I am using Kafka as Transaction Log, JDBC as Document Store and RocksDB as index store. I started two different nodes (with separate index store). When a transaction gets submitted to one of the node, it gets reflected in the other node as well. By any chance, I can restrict that to the node where the transaction is actually submitted? (Here two nodes are started on two logically different microservices).
Hey @U04DDKZJERF I'm not sure I understand the requirement. Are you saying that there are still some transactions you do want to see reflected across both nodes? But other transactions should not be reflected across both?
If you want the two nodes to be completely separate database instances (no shared transactions or data), you can use distinct JDBC schemas and kafka topics
So I want to have a common storage system which I am able to achieve it using Kafka + JDBC. First I start the two nodes simultaneously. Now the next step I perform is to submit a transaction via the ::xt/fn
. What happens it, it gets reflected in both the nodes.
To give some more context, I am running 2 clojure apps (App 1 and App 2) which are independent of each other other than the common XTDB. When I submit the transaction via ::xt/fn
which is using a function from the namespace only present in App 1, it throws a compile time exception in App 2. I noticed that somehow performing a transaction in App 1 (node 1) also gets reflected in App 2 (node 2). Is there any way I can prevent running the transaction in App 2 (node 2).
Let me know if this also doesn’t make sense. I will try to explain in some other way.
oh I see, so you are using functions within your ::xt/fn
that depend on distinct node-specific libraries/functions being on the classpath?
in general you should avoid those situations by either maintaining shared dependencies or pushing as much as you can into the transaction function definition - it is fairly critical that the transaction function code is 'stable' and not relying on dependencies which could have breaking behaviour changes
> oh I see, so you are using functions within your xt/fn that depend on distinct node-specific libraries/functions being on the classpath? Yes correct. I think it is better to push the logic within the transaction function rather then keeping in a user defined functions.