Fork me on GitHub
#datomic
<
2023-02-10
>
mx200000:02:20

Any thoughts on using datomic for an online multiplayer game? The whole data model seems to be a perfect fit, as you could just send (in a real time game) a few times a second the last transactions to the client so you already have a data model which describes only the changes made to the world and can send them cheaply.

Ben Damman01:02:41

Does the Datomic plugin for Trino ("Datomic Analytics") support INSERTs and UPDATEs in any way? My guess would be "NO" but had to ask. 😈

ghadi01:02:10

correct

👍 2
gratitude-thank-you 2
hanDerPeder14:02:12

When using limit with d/q and a history database, any guarantees as to what I will get back? Hoping it scans transactions newest to oldest.

hanDerPeder14:02:40

in other words, hoping this gives me the 10 latest adds on some-eid

(d/q {:query '[:find ?a ?v ?tx
               :in $ ?e
               [?e ?a ?v ?tx true]]
      :args [(d/history (d/db conn) some-eid)]
      :limit 10})

favila14:02:09

The return value is a set, so you have no guarantees

favila14:02:26

datalog results are unordered

ghadi14:02:18

consider using the log api or tx-range

hanDerPeder16:02:05

Hmm, so how would you do a '10 latest posts' type query?

favila16:02:58

query, include the sort key in the result, sort yourself

favila16:02:26

or make an index that is exactly your sort and use something like index-pull

favila16:02:00

Not being able to sort “over there” with the client api is a real bummer, but on on-prem this is fine and no different than what a builtin sort would have to do anyway.

hanDerPeder16:02:55

Using on-prem. Still trying to forget 15+ years of sql, I suppose 😄

Daniel Jomphe19:02:03

If you're looking to use WebSockets with Datomic Cloud Ions, this thread might be a good starting point. I'm wondering if some users have more up-to-date info than https://clojurians.slack.com/archives/CL85MBPEF/p1676057124117659?thread_ts=1675723956.514279&amp;cid=CL85MBPEF. We might soon want to move in this direction.