r/Clojure • • Mar 21 '26

Extensible Value Encoding: large 1GB clojure atoms memory mapped to disk

https://github.com/SeniorCareMarket/eve
32 Upvotes

3 comments sorted by

4

u/didibus Mar 21 '26

(e/atom {:id ::counter :persistent "./my-db"})

Is that really the API? The persistent option has to be a key of your map ? Shouldn't it be:

(e/atom {:id ::counter} :persistent "./my-db")

2

u/dustingetz Mar 21 '26

I'm not sure what's going on there but I think the actual API is `(e/atom config-map initial-value)` e.g.

(def counter (e/atom {:id ::counter :persistent "./my-db"} 0))

c.f. https://github.com/SeniorCareMarket/eve/blob/ac1640afdabeed38d5a7f5e9566cf1cc1a75cf45/test-e2e/eve/jvm_atom_e2e_test.clj#L56

2

u/ElQuique Mar 21 '26

JVM Clojure, Node.js ClojureScript, and Babashka processes can share and atomically mutate Clojure data structures via mmap files on disk.

That seems damn cool