Discussion:
differences from the peer and client on read?
Benoit Chesneau
2017-10-09 14:14:22 UTC
Permalink
I understand that anything done by the client is remote but what get the
client on read? Is it receiving objects cached on the peer on demand or
does it cache the query results?


In the doc [1] you're saying:

Datomic read operations include Datalog query and raw index access. With
the peer library, these operations all happen locally in process memory,
and the APIs are synchronous. Because of this locality, long-lived peer
applications deliver the best possible latency for read operations.

Does it means that the client only receive the results of the queries? What
is cached then ?

- benoit

[1] http://docs.datomic.com/clients-and-peers.html
--
You received this message because you are subscribed to the Google Groups "Datomic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datomic+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dustin Getz
2017-10-10 13:37:19 UTC
Permalink
Datomic client is designed to be lightweight The peer's internal cache is
much larger than the resultset, because Datalog starts considering many
datoms, filters that down clause by clause, to the resultset.

"This provides several benefits, but at the price of a heavier dependency
(both in code and in memory requirements) than a traditional client." [1]

If you want the peer cache then you need to be a peer. That is, I think a
reason why web browsers are not Datomic peers despite it being a common
feature request. I think, one reason for Datomic client api is to address
this gap, here is the stated motivation for client api: "A smaller
footprint is useful in environments that have operational limitations, or
where processes are small or short-lived." [1] so like browsers!

I think another motivation for Client API is that non-JVM platforms, that
today can't benefit from peer model today, can still benefit from other
properties of Datomic. I recall reading that the Client implementations
have very little or no platform dependencies, whereas the Peer
implementation is highly optimized platform code and thus is tied to the
JVM. I think it could be fixed but it does not seem important. If this is
wrong, someone please correct me.

[1] Datomic Update: Client API, Unlimited Peers, Enterprise Edition, and
More
<http://blog.datomic.com/2016/11/datomic-update-client-api-unlimited.html>

Here is a related discussion: Get all datoms relevant to an arbitrary query
<https://groups.google.com/forum/#!searchin/datomic/datascript%7Csort:relevance/datomic/j-LkxuMciEw/wT3I7moHAwAJ>,
you could try searching "datascript"
<https://groups.google.com/forum/#!searchin/datomic/datascript%7Csort:relevance/datomic/j-LkxuMciEw/wT3I7moHAwAJ>
for more discussion of the idea of a browser peer syncing caches.
--
You received this message because you are subscribed to the Google Groups "Datomic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datomic+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dustin Getz
2017-10-10 13:41:53 UTC
Permalink
Client API: "On the other hand, the object cache used for client queries
lives in a separate process, so it survives a client application restart."

I dont think the client app ("browser") has any caching at all, or only
very simple caching (I asked query Q at time T a moment ago). The quote
just means if you refresh your browser, the peer server which the client is
talking to, is still hot.
--
You received this message because you are subscribed to the Google Groups "Datomic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datomic+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Benoit Chesneau
2017-10-15 13:00:10 UTC
Permalink
i see, thanks for the answers :) As i undestand now’ the client as no cache per seé this is just the peer that still have data in its cache most of the time since it was just acced. Pretty good i would say.

benoit
--
You received this message because you are subscribed to the Google Groups "Datomic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datomic+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dustin Getz
2017-10-16 13:10:16 UTC
Permalink
Updating my answer: containerized services and microservices are another
fit for datomic client, because these processes may be short lived, we want
the peer cache to be long lived, so we put the peer cache in a Datomic Peer
Server and connect to it via a client.
--
You received this message because you are subscribed to the Google Groups "Datomic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datomic+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dustin Getz
2017-10-20 13:46:54 UTC
Permalink
More docs:

"Compared to the Peer API, the Client API introduces a network hop for read
operations, increasing latency. On the other hand, the object cache used
for client queries lives in a separate process, so it survives a client
application restart. This can reduce latency for read operations in
applications that are small and short-lived. *With both clients and peers,
Datomic supports integrated memcached so read latencies should be
acceptable for the vast majority of applications*." (emphasis added)

I dont understand what memcache can do for client, or why this sentence is
worded like this. BTW this entire thread predates datomic cloud.
--
You received this message because you are subscribed to the Google Groups "Datomic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datomic+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Daniel Compton
2017-10-21 02:30:29 UTC
Permalink
I'm not very familiar with the client, but I suspect that memcached is used
by the client's peer for caching data, rather than the client actually
talking directly to memcached.
Post by Dustin Getz
"Compared to the Peer API, the Client API introduces a network hop for
read operations, increasing latency. On the other hand, the object cache
used for client queries lives in a separate process, so it survives a
client application restart. This can reduce latency for read operations in
applications that are small and short-lived. *With both clients and
peers, Datomic supports integrated memcached so read latencies should be
acceptable for the vast majority of applications*." (emphasis added)
I dont understand what memcache can do for client, or why this sentence is
worded like this. BTW this entire thread predates datomic cloud.
--
You received this message because you are subscribed to the Google Groups "Datomic" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Datomic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datomic+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...