This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-22
Channels
- # announcements (16)
- # babashka (7)
- # babashka-sci-dev (14)
- # beginners (34)
- # calva (80)
- # clj-kondo (23)
- # cljdoc (17)
- # cljs-dev (1)
- # cljsrn (10)
- # clojure (51)
- # clojure-berlin (3)
- # clojure-europe (14)
- # clojure-italy (10)
- # clojure-nl (2)
- # clojure-norway (211)
- # clojure-uk (5)
- # clojurescript (4)
- # cursive (22)
- # datalevin (12)
- # datomic (2)
- # defnpodcast (1)
- # duct (5)
- # emacs (4)
- # events (2)
- # fulcro (3)
- # graalvm (1)
- # interop (3)
- # introduce-yourself (4)
- # java (1)
- # jobs (7)
- # kaocha (38)
- # leiningen (3)
- # lsp (11)
- # malli (4)
- # membrane (5)
- # music (1)
- # off-topic (28)
- # pathom (13)
- # pedestal (3)
- # polylith (4)
- # portal (10)
- # practicalli (1)
- # re-frame (33)
- # reitit (2)
- # remote-jobs (1)
- # sci (6)
- # shadow-cljs (49)
- # sql (4)
- # xtdb (3)
Just started to eval datalevin with nextjournal - very impressed with datalevin!!! - any others who managed to integrate it into the nextjournal-jupyter environment? - trying to figure out where to store the datalevin db-files... nextjournal has this versioned persistent filesystem mounted on /results... which doesn't allow for directories - could keep the db-files in the ephemeral filesystem (e.g. "/db") and then back those files up in /results - any experience/suggestions?
note that I got it to work well by simply adding the datalevin to the deps.edn file in nextjournal - the only thing left to really deploy it is to figure out where the database files should reside and how they are persisted...
You may try adding :nosubdir
to :flags
when run open-kv
. Please let me know if it works.
thanks for the suggestion! I see two data files being created for datavin-db: lock.mdb and data.mdb. Are those the only two?
the reason I ask is that nextjournal has a somewhat (convoluted?) way to refer to files in their version filesystem: you have to literally ask nextjournal GUI for the name and then manually add a reference to those files in your code (https://nextjournal.com/help/uploads-and-results?version=published).
Also... when i close the db-connection, does the lockfile get discarded/deleted (this could possibly be an issue when a new file gets created and an old lockfile exists on the versioned filesystem? Also to backup the db, should I only worry about the data.mdb file, forget the lock.mdb, or are there potentially others? Sigh... sorry for all those Qs - should have been easy...
So far I had been using "get-conn", which feels a little different from your suggested "open-kv" - do both return a same kind of connection to work with? (I can see that only open-kv allows you to pass in a :nosubdir in the option's :flag vector...)
If you are using the Datalog db, then there’s no option to avoid the data directory. open-kv is for working with the key-value store.
Yes, the two files are the only files and they have fixed names. They will not be deleted.
when you do backup, you only need to specify the directary, not the file names inside.
would datalevin work with symbolic links to the data&lock.mbd files? one option would be to copy the two files after creation into the versioned filesystem directory /results, get their file references, and create symbolic links to those files in the ephemeral filesystem like "/db/", and use that /db in the get-conn call... (also waiting for some more advise from the nextjournal folks...)