Fork me on GitHub
#datomic
<
2018-01-29
>
frankiesardo16:01:12

Hello folks, I'm trying out datomic cloud

frankiesardo16:01:29

I have set it up and I can connect to the instance on aws through the bastion using the ssh proxy

frankiesardo16:01:07

Now I'm deploying a simple lambda function to test the connection and I get an unavailable error

frankiesardo16:01:13

"errorMessage": "Unable to connect to system: {:cognitect.anomalies/category :cognitect.anomalies/unavailable, :cognitect.anomalies/message \"Connect Timeout\" ..}

frankiesardo16:01:21

I'm using the same config I use for the basion connection, removing the proxy-port map

frankiesardo16:01:23

{:server-type :cloud
:region "eu-west-1"
:system "datomic-cloud-demo"
:query-group "datomic-cloud-demo"
:endpoint ""}

frankiesardo16:01:08

And I have the lambda running on the same VPC as datomic

denik16:01:28

@marshall FYI client-api docs linked to from cloud (https://docs.datomic.com/cloud/client/client-api.html) point to on-prem docs in the q docstring (https://docs.datomic.com/client-api/datomic.client.api.html#var-q), since there are two client libraries now (cloud and on-prem), it should probably point to both or have separate docs?

marshall16:01:57

@denik yes, thanks - I’ll take a look at all the urls in the docstrings

marshall16:01:31

@frankie you’d have to authorize security group ingress from the security group you’re running the lambda in

marshall16:01:30

you can use the provided $(SystemName)-apps security group

marshall16:01:36

it should have the correct permissions

frankiesardo16:01:49

Excellent, thanks!

frankiesardo16:01:33

Ok, now I've got a different error

frankiesardo16:01:36

"errorMessage": "Unable to execute HTTP request: Connect to  [] failed: connect timed out",

marshall16:01:58

what IAM role are you using for the lambda?

marshall16:01:06

it will need IAM permissions to access Datomic Cloud

marshall16:01:32

Also, your lambda security group needs to allow outbound connections to S3

frankiesardo17:01:29

Mhmhm, I've added that but it didn't change the error

frankiesardo17:01:43

I will have a closer look, but thanks for the help so far!

robert-stuttaford18:01:52

@stuarthalloway are :db.type/keyword less storage efficient than :db.type/ref-as-enum? other than the cool VAET trick where you can d/entity-reverse-walk to references of an enum value, why would I use enums over keywords? so far, i’m finding that the api for keywords is far nicer — no having to handle idents in d/pull or d/q when using keywords, for instance. it does seem to be faster to use enums over keywords in Datalog, likely because of the under-the-hood switch to entity ids there

stuarthalloway18:01:26

@robert-stuttaford I would not worry about perf — use enums only if you need them for something keywords can’t do

robert-stuttaford19:01:10

right - such as adding other AVs alongside the ident

stuarthalloway19:01:06

@robert-stuttaford going back to an earlier question: squuids are ancient, not particularly important since http://blog.datomic.com/2014/03/datomic-adaptive-indexing.html

robert-stuttaford19:01:15

wow. shows how ancient my knowledge is 🙂 i’ve been religious about using squuid on our team. one less thing to worry about…

stuarthalloway19:01:27

@robert-stuttaford @denik updating the docs about other On-Prem/Cloud questions, will update you here

robert-stuttaford19:01:52

thank you Stu - your quick response is appreciated!

donmullen20:01:10

@marshall - is there a similar table or doc comparing on-prem client api to peer server and cloud/client?

marshall20:01:32

no(t yet) 🙂

jocrau19:01:14

I am currently experimenting with the Client API using [com.datomic/client-pro "0.8.14"] (rather than [com.datomic/client-cloud "0.8.50"]). It seems as if the Client does neither implement (delete-database [_ arg-map]) nor (create-database [_ arg-map]) of the Client protocol. Is that by design or just for now?

marshall19:01:23

That’s correct @jocrau - using client with Datomic on-prem you’ll need to do the delete or create database calls from a peer

jocrau19:01:06

Thanks @marshall. Will that also be possible from a client in the future?

marshall19:01:26

not sure. I’ll double check with the team and also try to clarify in the docs

ghadi21:01:19

@stuarthalloway what aspect of Adaptive Indexing obviates the need for squuids?

stuarthalloway21:01:03

“Sustainable import rates independent of db size” could also include “… and independent of distribution of data values”

stuarthalloway21:01:56

@souenzzo @val_waeselynck the explanation of as-of + with at https://docs.datomic.com/cloud/time/filters.html#as-of-not-branch covers all usage in Datomic, whether cloud or on-prem, client or peer. Does that answer the original question?

val_waeselynck09:01:16

@stuarthalloway well, if you confirm that long-lived db values may get resolved via asOf on the server-side, it follows that with() is broken on clients