Fork me on GitHub
#holy-lambda
<
2021-10-22
>
Benjamin08:10:19

How would you got about it if the lambda should transact stuff with datomic (dynamo) ? Atm I'm targeting graalvm

Karol Wójcik08:10:20

Don't get your use case. Could you elaborate?

Benjamin08:10:10

basically I have a lambda that get's triggered when our app has a release on android/ios store. And I'd like to keep some memory so I can do some process only if both ios + android are released

Karol Wójcik08:10:29

> And I'd like to keep some memory so I can do some process only if both ios + android are released Don't get this part. Lambda is triggered per release for ios or android. You would like to do some action only if there is a new release for both platforms?

Karol Wójcik08:10:38

I need some clear explanation, what you have and what would you like to achieve 😄

Benjamin08:10:43

yea basially having some state or database. So a quite general question

Karol Wójcik08:10:38

Do you have some experience with AWS Lambda on Node.js or Python? The approach is the same here as in all AWS Lambda runtimes. Basically the idea is that you have to initialize the connection only once per lambda initialization before handling the request. Therefore one of the options is init db before h/entrypoint macro or specify :init-hook for h/entrypoint.

(h/entrypoint [fns] {:init-hook (fn [] (init-database!))})

Benjamin08:10:33

ah interesting. No I'm completely new to aws

Karol Wójcik08:10:49

One initialization for one lambda instance creation

Benjamin08:10:11

I see and one lambda instance has some livetime or sth

Karol Wójcik08:10:25

Lambda can live up to 15min. If you're using dynamodb the integration is extremely straightforward.

👀 1
Karol Wójcik08:10:48

You can use faraday for this 😄

Karol Wójcik09:10:27

and if you would like to trigger a lambda upon a change in db you can also use HL for this