Fork me on GitHub
#datomic
<
2020-03-18
>
tekacs05:03:08

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

tekacs05:03:48

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

onetom05:03:13

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.

onetom05:03:50

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.

tekacs05:03:17

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

onetom05:03:13

with the help of https://github.com/ComputeSoftware/datomic-client-memdb 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
onetom05:03:44

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: https://docs.datomic.com/on-prem/architecture.html#storage-services It there isn't can we write one legally?

geodrome16:03:32

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

marshall16:03:56

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

marshall16:03:37

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

geodrome16:03:48

ok, thank you

geodrome16:03:58

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

marshall16:03:52

you can definitely get some cache similarity advantage that way

marshall16:03:07

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

marshall16:03:28

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

marshall16:03:09

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)

marshall16:03:41

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

geodrome16:03:24

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]}))

ghadi20:03:28

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

ghadi20:03:57

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]})

ghadi20:03:28

oh, I misread you

ghadi20:03:47

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

ghadi20:03:59

but rather the pull

marshall20:03:52

Docs for what you’re looking for ^