Building a CRUD App with Datomic Cloud Ions
jacobobryant.com
Building a CRUD App with Datomic Cloud Ions
1–10 of 28 posts
Re: Building a CRUD App with Datomic Cloud Ions
#2Takes some time to adapt way of thinking to its data model and I'm just starting to reap the benefits. Boy does this thing pack some serious power! Prodding the data for complex relations ("find two friends with same birthdays that also have cars of same color") becomes trivial, which opens up a whole new possible features I haven't dared to consider before. Combine it with React rendering and you get a very clean and powerful model for building complex web applications. I'm enjoying it a lot.
If anyone is interested in Datalog query language, here's a good resource: http://www.learndatalogtoday.org/
Re: Building a CRUD App with Datomic Cloud Ions
#3I'm working on a web app using the mentioned Datascript library. It is in-memory DB with Datalog query language, written as open-source implementation of Datomic principles. It's usable from Clojure(script) and JS. Takes some time to adapt way of thinking to its data model and I'm just starting to reap the benefits. Boy does this thing pack some serious power! Prodding the data for complex relations ("find two friend…
Wasn't that always a simple thing to do, e.g. in SQL?
And how about monitoring changes in the database based on a query? Is that possible and efficient?
Re: Building a CRUD App with Datomic Cloud Ions
#4I'm working on a web app using the mentioned Datascript library. It is in-memory DB with Datalog query language, written as open-source implementation of Datomic principles. It's usable from Clojure(script) and JS. Takes some time to adapt way of thinking to its data model and I'm just starting to reap the benefits. Boy does this thing pack some serious power! Prodding the data for complex relations ("find two friend…
> "find two friends with same birthdays that also have cars of same color" Wasn't that always a simple thing to do, e.g. in SQL? And how about monitoring changes in the database based on a query? Is that possible and efficient?
Something like: WITH stuff AS ( SELECT bday, carcolor, ROW_NUMBER() OVER ( PARTITION BY bday,carcolor ORDER BY bday,carcolor ) rownum FROM friends ) SELECT * FROM stuff WHERE rownum > 1;
Re: Building a CRUD App with Datomic Cloud Ions
#5I'm working on a web app using the mentioned Datascript library. It is in-memory DB with Datalog query language, written as open-source implementation of Datomic principles. It's usable from Clojure(script) and JS. Takes some time to adapt way of thinking to its data model and I'm just starting to reap the benefits. Boy does this thing pack some serious power! Prodding the data for complex relations ("find two friend…
> "find two friends with same birthdays that also have cars of same color" Wasn't that always a simple thing to do, e.g. in SQL? And how about monitoring changes in the database based on a query? Is that possible and efficient?
You don't do any string mungling, your query is itself composed of data structures. You can build it easily with code, so your queries become as elaborate as you can generate them.
Unlike SQL tables that you have to figure out from start, the data model is a collection of facts, with each fact consisting of {entity_id, attribute, value, transaction_info}. By adding facts to database you build the knowledge about entities and different relations between entities in an organic way. You can still use the table model, or you can use graph model.
The whole DB is just a value in memory. You can transit it to server, store history copies in memory (for undo/redo), do diffs, whatever you need.
As for monitoring changes, I'm using the Posh lib (also mentioned in article). It monitors the DB and re-renders react component if there are transactions relevant to component's queries. It seems very efficient so far, but I still have to test it with large number of components and transactions.
Re: Building a CRUD App with Datomic Cloud Ions
#6Earlier quoted context omitted.
> "find two friends with same birthdays that also have cars of same color" Wasn't that always a simple thing to do, e.g. in SQL? And how about monitoring changes in the database based on a query? Is that possible and efficient?
It's possible in SQL, in Datascript it's effortless. There's a big difference in mental overhead and thus how often you would want reach into DB. There are other benefits. You don't do any string mungling, your query is itself composed of data structures. You can build it easily with code, so your queries become as elaborate as you can generate them. Unlike SQL tables that you have to figure out from start, the data…
Interesting. Do you know if, upon a change, it reruns the queries from scratch, or does it update the results based on the actual changes?
Re: Building a CRUD App with Datomic Cloud Ions
#7The ideas seem interesting though. Is there an open-source equivalent of Datomic yet?
Re: Building a CRUD App with Datomic Cloud Ions
#8I'm working on a web app using the mentioned Datascript library. It is in-memory DB with Datalog query language, written as open-source implementation of Datomic principles. It's usable from Clojure(script) and JS. Takes some time to adapt way of thinking to its data model and I'm just starting to reap the benefits. Boy does this thing pack some serious power! Prodding the data for complex relations ("find two friend…
I had a beautiful dream of just streaming datomic out to datascriot but eventually gave up and went back to client side maps using reframe.
If Cognitect would release a performant JavaScript peer that would be a game changer for web dev. Just one db and effortless event streaming to and fro.
Re: Building a CRUD App with Datomic Cloud Ions
#9I'm working on a web app using the mentioned Datascript library. It is in-memory DB with Datalog query language, written as open-source implementation of Datomic principles. It's usable from Clojure(script) and JS. Takes some time to adapt way of thinking to its data model and I'm just starting to reap the benefits. Boy does this thing pack some serious power! Prodding the data for complex relations ("find two friend…
Performance is brutal though. For a moderately sized db client side datascript can be 100ms per interesting query unless you drop to indices. Might as well just do a server trip. I had a beautiful dream of just streaming datomic out to datascriot but eventually gave up and went back to client side maps using reframe. If Cognitect would release a performant JavaScript peer that would be a game changer for web dev. Jus…
Re: Building a CRUD App with Datomic Cloud Ions
#10I see two problems with Datomic: the pricing seems a bit high for home use, and the professional version has the problem that you have to submit your data to the cloud, which is not always possible as clients may not always allow sharing of data with 3rd-parties. The ideas seem interesting though. Is there an open-source equivalent of Datomic yet?
datalog, high performance, flexible deployment options, open source. especially interesting for us because you can actually remove data for gdpr/compliance reasons. Datomic has a lot of trouble with that in our experience