Fork me on GitHub
#datomic
<
2017-02-11
>
codxse07:02:16

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

stijn08:02:07

@limix 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

val_waeselynck15:02:36

@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.

codxse16:02:47

@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.

robert-stuttaford21:02:34

@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

sova-soars-the-sora23:02:13

@limix a single endpoint philosophy is the whole backing to Om.next 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 Om.next 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 om.next +clojurescript on the front-end and some sort of storage solution on the backend, datomic fits just fine.

sova-soars-the-sora23:02:32

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

sova-soars-the-sora23:02:10

@limix 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.