ActualizeA
Convex Community16mo ago
6 replies
Actualize

Run convex from AWS lambda

I have next JS application with convex back-end. I want to run my scalable code on AWS lambdas.
At first I wanted to use queues and pass data to the lambdas like that. Then I thought it might be simpler to just let each lambda access convex directly.

My convex folder is generated on my next JS project (The lambda code is a sub-project of that project)

This is the structure of my project (think I could do it better?)

project-root/ ├── src/ │ ├── app/ │ │ └── (Next.js app router structure) │ └── lambda/ (the lambda project) │ ├── src/ │ │ ├──lambda-code.ts │ │ └── convex-client.ts (Needs to access convex prefarably also in dev) │ ├── deploy.js │ ├── package.json │ └── .env ├── convex/ │ └── (convex files and folders) └── package.json

So, what I am really asking is what's the best way to re-use the entire convex generated folder on the lambda project? (lambda code is writing in typescript and bundled to javascript).

PS: also wondering if that's better than my original solution using queues which involves more calls to pass data. (And might be cheaper???).
Was this page helpful?