This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-07
Channels
- # announcements (1)
- # babashka (79)
- # beginners (177)
- # cider (27)
- # cljdoc (24)
- # cljs-dev (4)
- # clojure (43)
- # clojure-norway (7)
- # clojure-uk (3)
- # clojurescript (52)
- # conjure (12)
- # cryogen (1)
- # cursive (5)
- # data-science (7)
- # datahike (1)
- # datomic (1)
- # dirac (2)
- # helix (14)
- # jobs-discuss (130)
- # juxt (4)
- # liberator (4)
- # malli (2)
- # mxnet (2)
- # news-and-articles (1)
- # nrepl (19)
- # off-topic (27)
- # pathom (3)
- # practicalli (1)
- # re-frame (4)
- # reagent (2)
- # ring (7)
- # shadow-cljs (21)
- # spacemacs (11)
- # vim (38)
- # xml (2)
- # xtdb (17)
Hello! 👋:skin-tone-3: Im new to crux and trying to set it up for the following scenario: - I have a bunch of services as a part of bigger single service which depend on the data produced by each other - Currently its based on plain postgres but is getting increasingly complex to manage history and shared state - These services synchronize based on RabbitMQ and also use it for durable backpressure - These are mostly clojure but some in kotlin and have a possibility of more diverse tech coming in - Should be easy to be deployed on some scalable managed provider using RDS etc Given these requirements I was thinking using a temporal immutable store would be a better fit and also I always wanted to give crux a try 😄 I tried setting up a standalone crux HTTP node(as multiple non clojure/non jvm things need to talk too) backed by jdbc/postgres, but it always seems to choose the im memory KV store. Also I wanted to know if this is right thought process of setting it up like this without Kafka? Possibly there is a better way of setting up a Crux cluster? Any help is much appreciated!
my postgres+http config:
(crux/start-node {:crux.node/topology '[crux.jdbc/topology crux.http-server/module]
:crux.jdbc/dbtype "postgresql"
:crux.jdbc/dbname db-name
:crux.jdbc/host host
:crux.jdbc/port port
:crux.jdbc/user user
:crux.jdbc/password password
:crux.http-server/port http-port})
http
HTTP/1.1 200 OK
Content-Type: application/edn
Date: Sun, 07 Jun 2020 08:50:59 GMT
Server: Jetty(9.4.22.v20191022)
Transfer-Encoding: chunked
{:crux.index/index-version 6, :crux.doc-log/consumer-state nil, :crux.tx-log/consumer-state nil, :crux.kv/kv-store "crux.kv.memdb.MemKv", :crux.kv/estimate-num-keys 1, :crux.kv/size 0}
this is the diagram if it helps
hi! that sounds like a nice setup. I'm curious about using crux with non-clojure langs as well. I'm not sure if this is a typo but the topology vector you posted above is quoted, so the vars would not get eval'ed
you most likely need to include the kv store in the topology: https://opencrux.com/docs#config-properties
hey, do i need to include it? as far as i understood the doc, i need to include the modules i want to use in the vector. the kv-store is specified by the other things i include?
From version 20.01-1.7.0-alpha-SNAPSHOT the kv-store should be specified by including an extra module in the node’s topology vector. For example a rocksdb backend looks like {:crux.node/topology '[crux.standalone/topology crux.kv.rocksdb/kv-store]}
ah! could it be possible that the one from http server is overriding the one from the db?
i'm pretty sure the http module is orthogonal to specifying the transaction logs and document store
hmm, so it seems like specifying the jdbc topology should have txs and docs going to the sql db (https://juxt.pro/blog/posts/crux-jdbc.html) . Maybe you can debug first without the http interface to see if jdbc is working as expected
yes i had tried to run just the postgres backed node from the REPL and works as expected. just that when i add the http module it doesnt seem to work?
seems to work now! i just got confused by the status of :crux.kv/kv-store "crux.kv.memdb.MemKv"
i guess
Set each component up properly and it works! 😄 Thanks for the help
sweet! glad the battle is over ha - you mind posting your working node config? I've only been running a solo rocksdb setup so far and I'd like to try the jbdc setup
sure thing its more or less the same thing i started with, just was misreading the messages it seems. here is the component im using: https://github.com/bob-cd/bob/blob/queue/db/src/db/system.clj
starts up the HTTP server on 7778 by default and you check out the default postgres connection values