This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-28
Channels
- # aleph (3)
- # babashka (66)
- # beginners (96)
- # calva (45)
- # clj-kondo (28)
- # clojure (30)
- # clojure-dev (2)
- # clojure-europe (20)
- # clojure-germany (22)
- # clojure-norway (4)
- # clojurescript (176)
- # clojutre (1)
- # cursive (23)
- # datalog (6)
- # datomic (7)
- # docker (3)
- # emacs (3)
- # exercism (4)
- # figwheel-main (5)
- # fulcro (8)
- # gratitude (9)
- # hyperfiddle (8)
- # introduce-yourself (2)
- # jobs (2)
- # malli (4)
- # membrane (3)
- # off-topic (17)
- # polylith (3)
- # portal (2)
- # re-frame (27)
- # reitit (3)
- # releases (1)
- # remote-jobs (1)
- # shadow-cljs (152)
- # spacemacs (8)
- # tools-deps (15)
- # vscode (1)
- # xtdb (24)
Why is [(identity v) v1]
different from [v v1]
in or-join
? What does identity
do?
Does it magically produce a set from v
?
Hey @U028ART884X what is the wider example here? [(identity v) v1]
forces an evaluation order that is otherwise ambiguous if you were to use [(== v v1)]
I got it from you originally: https://clojurians.slack.com/archives/CG3AM2F7V/p1648633699555599
So if I could use ==
there why didn't you favor that instead?
Also what does it mean to force the order? As I understand the call to [(identity x) y]
would evaluate the first argument. But then what would the expression [x y]
mean inside or-join
?
Oh I see 😅
So in the context of that kind or-join I think either approach will work the same. Like it's essentially a performing a union of two sets either way.
As for your question about [x y]
...are you referring to the first argument of the or-join? If so, well that is simply acting as an kind of variable scoping boundary as values get passed from outside to inside the or-join and back out again, i.e. it is not a regular Datalog clause
Im puzzling through some architecture stuff - Why is it that queries can't/aren't run locally as with datomic?
In general, they are (at least if you're using xtdb embedded with Clojure). It's possible I'm misunderstanding your question, though?
> Datomic peers lazily read from the global index and therefore automatically cache their dynamic working sets. XTDB does not use a global index and currently does not offer any node-level sharding either so each node must contain the full database. In other words, each XTDB node is like an unpartitioned replica of the entire database,
Hm. So, by my understanding, these are two separate issues. One issue is where the data lives relative to your application, relative to the query boundary. In both xt and Datomic, if you are using the Clojure libs the data it operates on is local to the calling thread, as Jeremy mentioned above. Datomic doesn't provide a remote API (that I'm aware of, anyway) and XTDB provides the HTTP and http client which make the node "remote" relative to your application — not only out of thread, but out of process. That's the first issue, which doesn't relate to that comment in the docs. This comment in the docs is referring to how the database itself stores data. Datomic can store data remotely in a sharded configuration. When you query Datomic in this setup, you are still querying a node (I'm not sure if that's the right terminology, mind you — I haven't looked at Datomic in ~8 years) local to your app but that node can go grab data it lacks in its local cache from remote shards. The sharding will be transparent to you, I think. As of 1.21, xtdb doesn't have sharding or other separation of storage from compute features. All data is local to your node, but on disk (not in memory). If you want a second node, that node will also have all the data on disk. I'm not sure if that clears things up?
That's true, yes, indexes only store small top level field values, anything large will be retrieved from the doc store as needed (with an in-memory cache in front)
If you mean 'are there other kinds of errors that could be thrown', then I think the answer to that would be 'yes', like if tx-log or doc-store rejects the requests or throw timeouts