Fork me on GitHub

Hi, I'm not sure to ask this question here. But I didn't find the answer on the net.. what is datomic valueType equivalent to sql text type (I want store blog post for example). Is that string? Thanks


@aramz you could subscribe to the transaction queue, get the db-before and db-after from the transaction result, apply the query to both and see if there's any difference


@codxse you could use string or bytes, but keep in mind that Datomic is not well suited to store blobs. You may want to store this e.g in S3 and store only the key or URL in Datomic.


@val_waeselynck thanks for the answer, let say if the text that I want to store is not that large (not as large as image), it roughly 100 500 characters (perhaps not so much change), is that good practise to store it in string? I don't know the limitation string in datomic.


@codxse there’s no limit; it’s just that many large strings put pressure on the read side of the database, slowing it down as your database grows


@aramz a single endpoint philosophy is the whole backing to which is Clojurescript and UI smashed together with a graph query on the backend. I'm doing a realtime app that plays over sockets with Sente. subscriptions to queries as you say, is a great way to go. There are several frameworks if you are interested in building a website / webapp. Firstly, you can try Rum and Datascript. These are awesome and basically #datascript is a mini datomic on the clientside and when you have a pertinent transaction all you do is push the transacted delta to subscribed peers. #rum is html/reactjs-event-cycle templating (so there are components, and they get different signals like "i'm about to update/re-render, and some other "lifecycle" events) @tonsky has an incredible cat chat app up that is very elegant. It would be easy to extrapolate this to particular subsets users of users for particular updates. Depends on what you want to do overall, but Rum + Datascript is a great way to break into the realtime app world. Currently, I'm using and I have had the fortune to have already made a working version of my application in "stop-time" and now I am making a new version in "real-time" For all the things I want, it's changed the stack a bit: there is datomic on the backend, there is an http-kit server that runs sente, there is a clojurescript app that is loaded in the html, and once the app is loaded it communicates over the wire via sente / sockets to know when database changes happen. It sounds complex but it's not, I promise, it's just a lot of aggregated understanding. I would love to eventually streamline all the aspects I need into some sort of generic "app template" that I could use for all sorts of projects, and actually greater minds are already on the issue and there is #untangled which is an open source framework for building applications using +clojurescript on the front-end and some sort of storage solution on the backend, datomic fits just fine.


Wow that's a lot of words. That's like a mind-dump 2 months in the making


@aramz anyway, the main thing you were asking about "can i send just a tx delta to the subscribed users?" answer: yes totally and as far as I know that's the most elegant way.