Fork me on GitHub

I’m not sure if this is the right place for this question but I’m trying to have an AWS Lambda make a datomic transaction that is backed by dynamodb. This is using clojure/aws-java-sdk libraries which work fine using ec2, etc. I’ve got the lambda wired properly and I’ve followed the various docs on giving the right permissions to the associated role. Here’s mine: AWSLambdaDynamoDBExecutionRole AWSLambdaVPCAccessExecutionRole AWSLambdaExecute AmazonVPCFullAccess I’ve configured the lambda to be part of the default security group and set it to run in the VPC. The problem is that I get an exception-less timeout when trying to connect to the store using the uri. Thoughts?


On a related note I see that most of the libraries and discussion is around using cljs over node. The one cljs datomic library requires that there be a running peer that provides the REST api access it requires. There isn’t a lot of documentation on how to ensure that your lambda creates a peer upon invocation. Am I missing something ? I deployed via cloudfront following the basic install approach but the datomic docs on the REST api show a manual start of an api-ready peer. Is there some way to configure this on the transactor instance? Thanks!


@georgek Datomic + Lambda will not work well because you would need to launch a peer for each request (see!topic/datomic/OYJ4ghelmF0). As suggested in the Google Group post, you could setup the Datomic REST API and transact from the Lambda function by sending a request to the REST API. To prevent outside access to the REST API, you would probably need to setup the REST server inside an isolated VPC and only give your Lambda function access to that VPC.


yeah, in my experience connecting a new peer can take up to 90 seconds, kind of defeating the purpose of lambda


Just checking, is it safe to migrate to AWS longer resource ids ( when using the Datomic Cloudformation stack ?


@kenny @pesterhazy That makes so much sense I’m a bit floored. Thanks for the reality check and pointer to how to approach this!


I'm trying to do a restore-db. Whatever I try, I get this message:

clojure.lang.ExceptionInfo: :restore/roots-missing No database root for next-t 2568953 {:db/error :restore/roots-missing}
or this message:
clojure.lang.ExceptionInfo: :restore/no-roots No restore points available at file:/cn-catalog/db-backup/datomic/beta/ {:uri "file:/cn-catalog/db-backup/datomic/beta/", :db/error :r
Here are some examples of the commands I'm running:
datomic/bin/datomic restore-db file:/cn-catalog/db-backup/datomic/beta datomic: `ls -1 ~/dev/cn-catalog/db-backup/datomic/beta/roots | sort -n | tail -n 1`

datomic/bin/datomic restore-db file:/cn-catalog/db-backup/datomic/beta datomic:

datomic/bin/datomic restore-db file:/cn-catalog/db-backup/datomic/beta datomic: 6591640

datomic/bin/datomic restore-db file:/cn-catalog/db-backup/datomic/beta datomic: -t 6591640
Any ideas? I'm on Windows.


How do I retract a value from an attribute with the cardinality many and with the type ref? For example, :user/role-id has references to the role entity. If the :user/role-id contains [1 2 3] and I want to retract 2 so that the result is [1 3], how do I do that?


@teng [:db/retract eid :user/role-id 2]


same as a cardinality one retraction


@danstone So maybe the problem was that we tried to pass a vector of values.


yeah, if you want to retract multiple values you have to submit individual retractions for each value


Now it works!


when using the map form of transactions, it looks like using "reverse notation" is not supported: {:db/id .... :country/name "Germany" :city/_country #{[:city/name "Frankfurt"] [:city/name "Stuttgart"]}}


but I don't see why this wouldn't work in principle; it looks like a useful enhancement


or am I missing something?

Matt Butler17:11:51

Just to confirm, does setting an attribute to :db/unique :db.unique/value implicitly index the value? as implied by

To maintain AVET for an attribute, specify :db/index true (or some value for :db/unique) when installing or altering the attribute


@pesterhazy Yes, that's a known limitation. Reversed attributes aren't supported in transactions. I don't know if/when it will be.


@mbutler Yes, any kind of uniqueness implies indexing values.

Matt Butler19:11:56

Awesome thanks 🙂


Hi - do you have any resources on understanding Datomics relationship with Dynamo write capacity?


currently getting in the transactor - would want to avoid this


I can up the provisioned write capacity - but would like to understand how Datomic does it's writes, i.e. presumably it's a transaction per unit?


or one "write capacity unit" per datom - think it could be this?


@jonpither Datomic’s use of DDB writes doesn’t correlate exactly to transactions or datoms For every transaction, Datomic will write durably to the transaction log in DDB, but the transactor also writes a heartbeat to storage and, most importantly, will write large amounts of data during indexing jobs.


Because of this, you need to provision ddb throughput based on the need during indexing jobs, not ongoing transactional load


Great my next Q is answered there about capturing the throttles