Fork me on GitHub
#datomic
<
2020-06-08
>
Alex Miller (Clojure team)02:06:12

Yes, for on-prem a system will have one active transactor (may also have an HA transactor)

joshkh11:06:45

i can't believe i'm asking this, but are there any future plans for a nodejs compatible datomic cloud client? i'm just thinking about speedy lambdas that can't really afford the cold startup time of the JVM. i guess there's always graalvm, but still, the ease of whipping up and deploying a cljs lambda is attractive.

jdhollis15:06:16

You could also just use ions with HTTP Direct.

jdhollis15:06:45

(I’m assuming you’re wiring these up to an API Gateway.)

jdhollis15:06:32

They stay spun up.

jdhollis16:06:49

You have to handle routing within the ion, but it has a significant (positive) response time impact.

joshkh16:06:59

sounds promising but i don't quite follow. HTTP direct lets me route api gateway traffic directly to datomic, but i don't see how that lets me query datomic from a cljs (nodejs) lambda which is my goal 🙂

joshkh16:06:25

it looks like on-prem has a REST api, maybe cloud has something similar?

jdhollis17:06:06

What’s your Lambda hooked up to?

jdhollis17:06:35

Typically, I only worry about cold starts if it’s user-facing.

jdhollis17:06:40

(Though I suppose there’s a Rube Goldberg version that hits a private API Gateway endpoint proxying directly to an ion.)

joshkh20:06:29

^ yeah, i entertained the idea 😉 i don't have a specific use case, but let's say something like an API Gateway Authorizer, or an authentication lambda hooked in to Cognito, both of which are customer facing

csm21:06:30

Not too long ago I went and made a nodejs cloud/peer server project: https://github.com/csm/datomic-client-js not official, but it does work with cloud and peer server

jdhollis21:06:05

Alas, not a lot of good options there if the Lambda is low traffic.

jdhollis21:06:29

Even the Lambdas created to proxy to ions use the JVM if I’m not mistaken.

jdhollis21:06:31

The API Gateway version might be the best option, latency-wise 😛

joshkh12:06:02

@UFQT3VCF8 this is fantastic, thank you for sharing! i'm curious - why did you write the library in JS and not CLJS?

arohner13:06:44

Is there a way to assert a query uses an index?

colinkahn21:06:53

I’m trying to understand the terminology in datomic for “peer”. Is the Peer api and peer server similar in some way or does peer just have two meanings?

favila22:06:13

The peer api is the api used to become a peer. A peer server is a peer that provides the server half of the client api

favila22:06:12

“peer” means roughly “member of the datomic cluster”. They have direct connections to transactor and storage

colinkahn15:06:53

@U09R86PA4 thanks, I think it makes sense now. Peer and peer server is the full Datomic api with caching etc, where Client is just an interface that connects to the peer server.

favila16:06:18

correct. Although a bit of nuance: the client api is designed to be possible to use from a non-peer process, but in certain circumstances for performance it can actually run in a peer and use that peer’s resources directly

favila16:06:23

I think this is what ions do

favila16:06:00

they use the client api, but ion processes are also peers so the client api is implemented to call directly into the peer api without crossing a process boundary

colinkahn19:06:28

Interesting, but this is some custom thing that is happening? I was curious if you could use the connection from the peer api with a client, but the apis didn’t seem compatible, with Client requiring an endpoint. But there was a :server-type :local which I couldn’t find docs on that made me wonder

favila20:06:05

there are three implementations I know about: client (use a transit connection to a server, shared by peer-server and cloud, used by ion if running outside the cloud), peer-client, and local (used by ion if the ion is running in the cloud)

favila20:06:59

peer-client looks like it would be for on-prem peers; local is for cloud “peers”

favila20:06:23

but I’ve never seen the implementations for either one, and I don’t think they’re directly supported