Fork me on GitHub

Ok, I have moved the loading of data (transact) to server and then using edn serialization to pass it to server. The advantage is that things are not slow on mobile devices. I am still looking for ways to optimize the loading on server side but it is a better solution for now.


Is there an easier interface for data script, where to the user it looks like inserting maps, and matching "pieces" (or map entries) of maps to query?


@tawus using transit can make things even faster


@escherize no, nothing I’m aware of


@tonsky: using transit with datoms instead of entity maps. right ?


I meant in general transit is faster than edn


I don't really understand what are sending from your description


I have datomic data (about 5000+ entities for now). I was passing this from server to client and then using transact to add it to the datascript database on the client. Although it was taking 2-3 seconds on my desktop browser but on mobile devices it was taking more than 10 seconds. Now I am using datascript on the server too. So the data from the datomic is inserted into datascript database and then serialized as edn to the server. On client we just use conn-from-db after deserialization. So, in summary, the data insertion into datascript database is happening on server, then datascript database is serialized to the client as edn, and then data deserialization is happening on the client. Although it is almost the same thing but now the painful part is on the server and so mobile devices are as fast as the desktop browser. I hope it is clear now.


Yes, thanks


You did all the right things: servers are much more performant than clients, and Clojure datascript is about twice as fast as client datascript


But I'd recommend to use transit as serialization format


Decoding it on a client MUCH faster than EDN


There's a library for DataScript called datascript-transit


It provides custom DB and Datom readers/writers for transit


Give it a try, it should be very easy to get started


And perf benefits are potentially very big


Ah. Sorry, I confused transit with transact may be because I have been using too much of transact 🙂 Thanks for the suggestion. I’ll check it out and let you know how it goes. Thanks! really appreciate your help.


Haha yeah they look really similar :)