Fork me on GitHub

could anyone speak to whether the peer vs. client, on-prem vs. cloud discussion has a settled answer for new projects?


I'd love to use peer + on-prem, but I have a lingering worry about its development stalling out or other similar complications over time


The ability to excise and being able to depoly on non-aws infrastructures such distinctive features of datomic on-prem are important requirements for medical and banking industries still, so i would be really surprised if the on-prem development would stall.


on the question of client vs peer, im unsure... i really love the entity api and the fact that i can just run integration-level test using in-memory dbs, which allow direct access to my database functions.


mm -- I'm curious to hear if there's an answer on the topic that's settled -- I'll wait to hear, or might reach out to ask


with the help of you can still create a specific database state using the peer api, then run your app functions which use the client api against that prepared state

👍 4
Jon Walch16:03:17

I use this library daily and the maintainer (@kenny) is awesome

❤️ 4
👍 4

btw, is there any official or non-official Python lib for the Datomic Client API or at least some specs? All I gathered from the docs that the client api is a http api using transit encoding as seen it being mentioned on this diagram: It there isn't can we write one legally?


Can a datomic peer server and client app process reside on the same machine to eliminate the network hop?


yes they can; keep in mind that if you do so you’ll be sharing system resources


and system problems will take them both down, as opposed to if you have one peer server serving multiple remote clients


ok, thank you


Is the typical architectural pattern to have distinct peer servers serving groups of clients with same/similar working sets?


you can definitely get some cache similarity advantage that way


i’d say ‘typical’ depends a lot on your use patterns


i.e. how much query work you need to do, how many clients you have, what your deployment environment makes feasible


at a high level, a beefy peer server with a big heap (and maybe valcache) can often serve numerous clients (again, depending on their workloads/etc)


but you could also stand up numerous peer servers, each serving different workloads


ok yeah, makes sense, thanks

Jon Walch20:03:46

Is it possible / whats the proper syntax to do something like this for Datomic Cloud?

(let [attrs '[:foo/bar]]
  (d/q {:query '[:find (pull ?e ?attrs)
                 :in $ ?attrs
                 :where [?e :foo/baz? true]]
        :args  [db attrs]}))


I would look to the d/datoms or d/index-range API @jonwalch


of course you could do it by generating the query datastructure with ordinary clojure

Jon Walch20:03:39

This worked

(d/q {:query '[:find (pull ?prop attrs)
                   :in $ attrs
                   :where [?prop :foo/baz? true]]
          :args  [db attrs]})


oh, I misread you


(you're not looking for a where clause attribute binding to be dynamic)


but rather the pull


Docs for what you’re looking for ^