6 ms·
DataScript: Immutable database and Datalog query engine in ClojureScript
- deleted 11y ago[deleted]
- robertfw 11y agoThis is a project I've kept a closer eye on, as I'm thoroughly fascinated with Datomic, and the concept of using a similar system alongside functional approaches like React seems a good match. Would love to hear comments from anyone who has given DataScript a test drive - I'm guessing from the alpha state that no one is using it in production but hey, who knows... some people like to live dangerously.
- Nekorosu 11y agoWrong guess. The project's repository has a list of things people built with DataScript. One of those is https://precursorapp.com https://precursorapp.com It's highly usable, stable and fun app!
- drcode 11y agoFYI, there's new developments in this area... there should be a video up on YouTube about "Om.Next" in a week or so that details using datomic & Om with a relay-style mechanism.
- robertstutt 11y agoWe're using it in production, but then, the author is on our team. We've been using Datomic in production since Jan 2013. It's as good as it says on the tin. I love living dangerously, if danger means using full-stack Clojure and immutability -grin-
- dwwoelfel 11y agoWe're also using it in production, and it works really well when paired with Datomic. Thanks to transaction queues on both ends, we can set up a meteor-style sync that's pretty handy. It's also well-suited for rapid-prototyping. I'm working on a small project that will eventually need a backend, but for now I just store everything in a datascript db and serialize that to localStorage. When I'm ready to add a backend, I'll just subscribe to datascript's transaction queue and forward them to be saved on the server.
- NhanH 11y agoThe syncing in meteor-style is something I've been interested in for a while. Do you by any chance have any document on how it's done?
- fnordsensei 11y agoSeconded.
- jefffriesen 11y agoThirded.
- deleted 11y ago[deleted]
- wereHamster 11y agoImmutable database? That doesn't make sense. If you can't mutate it, how do you write to it? How do you update records in it? If it's really immutable then you can't. Such a database is a compile-time constant. These days everybody seems to throw around terms like immutable, isomorphic, pure etc. without actually knowing what they mean, or using them in contexts whey they don't make any sense.
- vruiz 11y agoThe data is immutable, not the database itself, meaning that you create entries but not modify them. The same way you can not modify a constant after you create it. "Immutable data database" would sound a bit redundant.
- j-pb 11y agoThe database is in fact immutable, it's just a persistent data-structure that allows for fancy queries. You wrap that data-structure/database in a mutable reference type (an atom), like you do with any other data-structure in clojure if you need change.
- amirouche 11y agoI did not understand persistent until someone point me to the wikipedia article [1]: > In computing, a persistent data structure is a data structure that always preserves the previous version of itself when it is modified. Such data structures are effectively immutable, as their operations do not (visibly) update the structure in-place, but instead always yield a new updated structure. The way I understand it in terms of python: It's like a nametuple or dict, where each update return a new namedtuple/dict with the new values for modified attributes but still the old values for attributes that did not change. It doesn't need to deep copy all the datastructure/database. This is not persistent as in "stored on disk". Being append only is a way to achieve persistence except it is also applicable to non-stored-on-disk datastructures. [1] https://en.wikipedia.org/wiki/Persistent_data_structure https://en.wikipedia.org/wiki/Persistent_data_structure
- 11y ago
- escherize 11y agoI've been thinking a lot about using a datascript database in place of a large mutable deeply nested hash map, or other non-regular chunk of data, to keep track of state using the amazing clojurescript library re-frame[1]. There are some times when having a novel way to query could lead to simpler data. [1] https://github.com/Day8/re-frame/ https://github.com/Day8/re-frame/
- raju 11y agoI believe the author of DataScript also wrote Rum [1] which is a lightweight wrapper around React. [1] - https://github.com/tonsky/rum https://github.com/tonsky/rum
- KurtMueller 11y agoI've been playing around with re-frame and it's pretty damn easy to use. What other technologies are you going to use alongside it?
- jwr 11y agoAs a datapoint, I'm using DataScript in a project and I'm quite happy with it. It wasn't quite the promised land, but it solved many hard problems for me.
- casperc 11y agoI wonder when we are going to see an open source implementation of Datomic's main ideas in the database space.
- robertfw 11y agoThere looks to be a dormant attempt at the alpha stage here: https://github.com/runexec/PossibleDB https://github.com/runexec/PossibleDB for bonus points, it uses rethink as the backing store
- tonsky 11y agoDataScript already can run on JVM natively. Only thing missing is durable storages (it’s inmemory only now, same as JS version)
- dmix 11y ago> What if creating a database would be as cheap as creating a Hashmap? I wanted something like this for Go recently, settled with SQLite :(
- amirouche 11y agohow do you compare datascript/datomic to neo4j?