This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-03
Channels
- # aws (1)
- # beginners (5)
- # boot (46)
- # cider (6)
- # cljs-dev (421)
- # cljsrn (74)
- # clojure (77)
- # clojure-greece (1)
- # clojure-italy (7)
- # clojure-russia (12)
- # clojure-serbia (42)
- # clojure-sg (1)
- # clojure-spec (10)
- # clojure-uk (38)
- # clojurescript (40)
- # core-async (14)
- # data-science (1)
- # datomic (18)
- # emacs (2)
- # events (1)
- # garden (4)
- # gorilla (4)
- # graphql (5)
- # hoplon (69)
- # luminus (1)
- # lumo (1)
- # off-topic (31)
- # om (31)
- # om-next (2)
- # overtone (3)
- # pedestal (1)
- # precept (4)
- # re-frame (23)
- # reagent (2)
- # remote-jobs (1)
- # ring-swagger (23)
- # rum (7)
- # spacemacs (7)
- # sql (4)
- # unrepl (9)
- # untangled (5)
- # vim (11)
- # yada (5)
is d/transact-async
bound by datomic.txTimeoutMsec
as d/transact
is?
gotcha.
thanks @potetm
Hi! Quick question on datomic data modelling: how would you store a large sequence of items (e.g. a news feed) in such a way that the N latest items can be retrieved efficiently?
@hmaurer - I think this kind of thing might not be easy in Datomic. (I hope somebody more knowledgeable about Datomic corrects me though.)
Or, wait…unless you mean the N most-recently-transacted items. In which case maybe the Log API would be what you need?
Disclaimer: speaking from semi-ignorance here…
@jeff.terrell haha no problem, that’s what I do most of the time. The N most-recently transacted items could work but I was looking for a more general solution. From what I understand about Datomic I think you are right though, it might not be possible without building an additional service…
One possibility would be to subscribe to the stream of transactions (I think this is possible in Datomic), then maintain a data structure with the information you need.
@hmaurer @jeff.terrell the disadvantage with walking the log backwards is you have to keep reading chunks of N txes until you’ve filled however many items you need. in a database with lots of other stuff, this could mean traversing a lot of non-news-item txes. you could use the linked-list approach, where the latest item points to the next-latest item which points to the next-next-latest item which …, which then gives you a pretty straightforward path to discovery.
robert-stuttaford: Ah, yeah…that's familiar, now that you say it. Thanks for clarifying that.
i believe Datomic’s feature request thing has a request for traversing indexes in reverse, which would give you a very clear and direct path: traverse the “primary key” attribute in reverse.
Here's a link to that feature request (might have to log in through http://my.datomic.com first, I dunno): https://receptive.io/app/#/case/17927
@robert-stuttaford hi and thank you! Is there an efficient Datalog query to get the top N items from a linked list?
@robert-stuttaford Also, is there a way for a service to follow the transaction log while ensuring that it doesn’t “miss” any transaction? You mentioned using Onyx so you might know about this