Fork me on GitHub
#clojurescript
<
2020-07-29
>
aaroncoding02:07:25

Hey all. I'm planning out an app with datomic + ring + cljs. I'm trying to decide on the best way to sync data between frontend and back. Is datasync any good? Anything else like it? Or would I be better off rolling my own?

sova-soars-the-sora21:08:04

Sente is great for coordinating between server and client. Then I would say use datascript on the front-end to hold mini-instance databases for the CLJS and have datomic or datahike on the backend to "store store." Sente can do both ajax and websockets. Not sure what datasync is. The best way imho is to only send "transaction deltas" across the wire which means instantiating the relevant data on the client and only transmitting updates from the server, this has many benefits including speed. Usually my model is to have the client send a message to the server, the server does something with it, and potentially broadcasts a new message out to all clients. clients get a msg, update their local data, their local data is automatically rendered into the view via rum/react components that elegantly map over data.

zilti22:08:44

Another good option could be Fulcro. Though it is a quite hefty amount of stuff you'll have to look at at once.

3
sova-soars-the-sora21:08:04

Sente is great for coordinating between server and client. Then I would say use datascript on the front-end to hold mini-instance databases for the CLJS and have datomic or datahike on the backend to "store store." Sente can do both ajax and websockets. Not sure what datasync is. The best way imho is to only send "transaction deltas" across the wire which means instantiating the relevant data on the client and only transmitting updates from the server, this has many benefits including speed. Usually my model is to have the client send a message to the server, the server does something with it, and potentially broadcasts a new message out to all clients. clients get a msg, update their local data, their local data is automatically rendered into the view via rum/react components that elegantly map over data.