This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-03
Channels
- # announcements (1)
- # babashka (31)
- # babashka-sci-dev (53)
- # beginners (34)
- # calva (54)
- # cider (15)
- # clj-kondo (9)
- # clojure (115)
- # clojure-dev (19)
- # clojure-europe (21)
- # clojure-nl (1)
- # clojure-norway (78)
- # clojurescript (10)
- # clr (9)
- # community-development (9)
- # core-async (24)
- # cursive (18)
- # datomic (59)
- # emacs (43)
- # figwheel-main (2)
- # fulcro (4)
- # graphql (4)
- # malli (7)
- # meander (12)
- # nbb (14)
- # off-topic (22)
- # polylith (9)
- # re-frame (5)
- # reitit (3)
- # releases (1)
- # shadow-cljs (36)
- # sql (1)
- # tools-build (23)
- # xtdb (13)
I've had an idea for an app. I want to use xtdb as a sort of cache for data from my network gear. I have switches with a list of mac addresses and ip addresses. I can use an api to pull out those ips and macs. I would like to create a document in xtdb with that data, say 1 document per switch. I'll run a job that pulls the data every X minutes and inputs it into xtdb. Is there a way to compare the data I get from the api, to the xtdb document without pulling the entire document to compare them in memory? I would only like to update the document if things change.
I guess the comparison will still have to happen in memory ultimately, but you can pass the data from the API into a query with :in
and use something like [(xtdb.api/entity $ ?id) ?e][(= ?e ?data)]
So there is no way to have xtdb say run a checksum function against the document, and I can run the checksum against the data from the api, and just compare the checksum value?
Internally there are hashes that could do this, but I can't think of a clean way to access them via a query right now. I mean you could use internal APIs...but that's not ideal
Ok thanks, if this is doable, even if I'm using internal apis then I can scale my solution up to thousands of switches which is what I need.
I don't want to be writing the full document every 5 minutes 5000 times, when data only changed on some much smaller subset of switches.
Actually the entity-history API surfaces the hashes also, and is probably usable for this.
I'll look, just didn't want to pick xtdb if this was impossible. Thanks much for the info.