Actualize
CCConvex Community
•Created by Actualize on 10/17/2024 in #support-community
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???).7 replies
CCConvex Community
•Created by Actualize on 10/8/2024 in #support-community
Convex + Nextjs using preloadQuery inside layout.tsx
Hi,
I am trying to understand if doing a preloadQuery inside a layout.tsx and share it amongst my "use client" pages through a "react context" has any advantages over using useQuery on each page (assuming the data hasn't changed). Or if it's an anti-pattern cause layout.tsx is loaded once and will not cause re-renders?
7 replies