Fork me on GitHub
#datascript
<
2022-04-04
>
metasoarous17:04:10

Another option here @chase-lambert is to try out #datahike, a fork of datascript which supports durability (persisting to disk). At the moment, I think it officially only supports the JVM, but durable JS/browser support is in beta, and writes out the data to an indexeddb.

metasoarous17:04:26

PS the terminology is a little confusing here, since technically, a datascript database value is a persistent data structure, but we often talk about persisting to disk. In database-specific terminology, durable (the D in ACID) is somewhat more precise and less potentially confusing, even if not always used as frequently in informal technical discussions.

metasoarous17:04:35

Using #datahike, or writing an entire datascript db value to localstorage, is fine if you only want the data to be accessible from a single device. But obviously, if you want to share state/data between devices, you either need a central database or some other form of data transfer between clients. Building out an entire SQL data model is doable, and affords some benefits, but is also a lot of work, and you may find it more natural to use either #datomic or #datahike on the back end for this purpose, since then you'll have a more similar data model across the system.

Josh21:04:09

@chase-lambert Hey I work at Roam and I open sourced our original datascript persistence code awhile back https://github.com/panterarocks49/datascript-firebase. It’s very much just a POC but it could give you an idea of how we do it

👋 1
Chase23:04:21

Great stuff here, I will check these out. Thanks folks!