This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-04-11
Channels
- # announcements (15)
- # babashka (13)
- # babashka-sci-dev (2)
- # beginners (80)
- # clerk (11)
- # clj-commons (4)
- # cljs-dev (1)
- # cljsrn (1)
- # clojars (19)
- # clojure (48)
- # clojure-austin (2)
- # clojure-australia (1)
- # clojure-china (1)
- # clojure-europe (26)
- # clojure-filipino (1)
- # clojure-hk (1)
- # clojure-hungary (32)
- # clojure-indonesia (1)
- # clojure-japan (1)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-sg (1)
- # clojure-taiwan (1)
- # clojure-uk (2)
- # community-development (7)
- # datomic (15)
- # emacs (6)
- # fulcro (2)
- # gratitude (1)
- # hoplon (3)
- # hyperfiddle (28)
- # inf-clojure (14)
- # introduce-yourself (1)
- # jobs (1)
- # joyride (4)
- # lsp (50)
- # malli (4)
- # nrepl (2)
- # polylith (12)
- # shadow-cljs (27)
- # spacemacs (3)
- # sql (8)
- # tools-build (11)
- # xtdb (22)
FYI: I just pushed breaking changes to master without documentation. Reminder to please get off of master and use the https://github.com/hyperfiddle/electric/blob/master/CHANGELOG.md
I did a quick check for dependency behavior with #babashka-neil.
TL;DR:
• neil dep add com.hyperfiddle/electric
installs version v2-alpha-263-g89da9d11
• running neil dep add com.hyperfiddle/electric
again when an old clojars-alpha version is installed, installs the latest clojars alpha version
---
Details:
1. neil dep add com.hyperfiddle/electric
installs v2-alpha-263-g89da9d11
2. but neil dep upgrade com.hyperfiddle/electric
doesn’t seem to be able to update an old electic version to the new version.
3. running neil dep add com.hyperfiddle/electric
again when an alpha version is installed installs the new version.
neil 0.1.60
changed the default dep add
behavior to add the latest unstable version of no stable versions are found. But nep upgrade
hasn’t gotten the same behavior.
So using neil dep add
seems to give the latest recommended alpha version.
what?
oh, sorry, that probably read like it was totally out of context. i was thinking that the recent change in neil
behavior might be useful for electric users, since it matches which electric version you want people to use.
what is neil?
Neil is a babashka CLI for installing and updating Clojure dependencies in deps.edn
projects:
https://github.com/babashka/neil
I'm wondering, how I would do a cloud deploy like electric has for the example pages w/ 5 worldwide mirros
you’ll need a cross region cloud database like say google spanner not xtdb - it’s not trivial
You can use a single central document/tx store for xtdb and deploy the electric instances to the edge. xtdb will store the document and tx logs on each node so you would only have to go to the central db for writes or cold reads. If you're using http://fly.io you should be able to just deploy a single region postgres and use that. you can get help on setting up your xtdb config in #CG3AM2F7V, you'll probably want to utilise checkpointing or the electric nodes will be slow to start
@U7KPK060K please say more and/or ELI5 without XTDB prior knowledge and i will add this to our docs
I'm far from an expert on XTDB so @U899JBRPF correct me if I'm wrong about any of this, but here are the basics as I understand them: • an XTDB deployment consists of one or more Nodes, a document store and a tx store (immutable transaction log of changes to the doc store). You can choose different places to persist these, by default I think they both get stored on the node using rocksdb, but you can also persist them outside the node using one of thehttps://docs.xtdb.com/storage/ • the XTDB nodes usually run in the same process as the host application (in this case electric) and each node connects (remotely via http/jdbc etc or in memory/local disc) to the doc/tx store • when a node starts up it will retrieve a copy of the indexes and store them in memory. queries made on the node (e.g using xt/q or xt/entity) will be executed against these local indexes (though I'm a little unclear about this because I know you can configure the amount of memory available to xtdb for local indexes, so possibly there are cases where the query will have to wait for the node to fetch data from the central store). • Deploying electric to the edge is probably beneficial if the app isn't write heavy, as each edge node will effectively cache the db and trips to the central store will only need to happen when doing writes or reading recently stored data, but electric does encourage frequent writes for realtime applications and in those cases it might be better to have the electric node close to the doc/tx store There is more info available here (and in the guides/tutorials on the same site) https://docs.xtdb.com/concepts/what-is-xtdb/

I just figured XTDB is a drop-in and free replacement for Datomic, is this assumption flawed
datomic free is probably the easiest possible thing
It's still not quite trivial with docker, you'll need to configure a persistent disk for the state if you haven't used Docker before. (IIRC, i can barely keep the container stuff straight) The dead simple thing is to use digital ocean, ssh in, mount persistent disk from digital ocean admin panel, install datomic, run app
Once you outgrow that you can dockerize it
Okay cool. So i can copy the electric-starter-app to my server, link in datomic, and should be good to go?
I usually log into a box and run a server from a specific ip. cloud deploys are a little different and i was wondering if anyone had any pointers
do you need cloud? we need it because our demos are accessed worldwide; digital ocean by ssh is perfectly acceptable
you can also look into railway, http://render.app, google cloud run - these all involve learning docker, which with XTDB may not be trivial
really figuring how how to run XTDB in prod is the first thing to do, this will determine your options for hosting
I see, I don't need cloud. I just thought it was the next logical step. But if db is whack++ then I can just do a singular local instance based in NYC area or whatever the digital ocean cluster is
Also, unrelatedly to deployment,
I have a question regarding views. I have a dom/button with the on-click set to toggle an atom, and an if
statement in the view (or a case
statement) but the view never changes.
I'm curious what I would be doing incorrectly there
post the snippet, did you forget e/watch?