Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs]: how functions work in a PaaS environments like Render.com #9741

Closed
1 task done
suzdalnitski opened this issue Dec 21, 2023 · 4 comments · Fixed by #9742
Closed
1 task done

[Docs]: how functions work in a PaaS environments like Render.com #9741

suzdalnitski opened this issue Dec 21, 2023 · 4 comments · Fixed by #9742

Comments

@suzdalnitski
Copy link
Contributor

Summary and description

It's not entirely clear how do functions in api/src/functions work. Eg what happens when the GraphQL handler in api/src/functions/graphql.ts is getting called in the context of a PaaS like Render.com? Are they automatically getting wrapped in a Fastify server?

Or do I have to also deploy an AWS Lambda in addition to Render.com? What about other functions that I may add to api/src/functions? Like functions/auth.ts, which was generated by adding in the SuperTokens auth (which also makes use of supertokens-node/framework/awsLambda, so I'm not sure if I have to make use of AWS for auth).

Are you interested in working on this?

  • I'm interested in working on this
@jtoar
Copy link
Contributor

jtoar commented Dec 22, 2023

Hey @suzdalnitski, yeah there could be more clarification for sure. You can think of functions in api/src/functions as just endpoints. In the context of Render, Render just starts the api server which is a Fastify sever, and yes all the functions in api/src/functions are automatically registered onto the server, and request adapters are automatically configured to handle the translation between Fastify's request/reply objects to the functions' AWS Lambda signature.

We're also thinking of moving away from the AWS Lambda signature which would probably remove a lot of the confusion here.

This doc could probably use an update (even the title of it) if you're interested: https://redwoodjs.com/docs/serverless-functions.

@suzdalnitski
Copy link
Contributor Author

@jtoar thanks, I've added some clarification, please let me know if it is good enough: #9742

There are lots of references to Serverless Functions throughout the docs, but I think this should remove most confusion?

@jtoar
Copy link
Contributor

jtoar commented Dec 22, 2023

@suzdalnitski yeah I wouldn't update them wholesale yet, the two you did seem like good callouts

@suzdalnitski
Copy link
Contributor Author

@jtoar this is not entirely related, but do you think it would make sense to add a document comparing different deployment options? From the current docs it is not entirely clear which option works with Redwood the best (with the least amount of effort to set up). It took me a couple days to go over the available options, and basically settle on Render (with Fly being another solid option).

jtoar added a commit that referenced this issue Dec 22, 2023
…ed in a non-serverless environment (#9742)

Closes #9741.

---------

Co-authored-by: Dominic Saadi <[email protected]>
Tobbe pushed a commit that referenced this issue Dec 22, 2023
…ed in a non-serverless environment (#9742)

Closes #9741.

---------

Co-authored-by: Dominic Saadi <[email protected]>
Tobbe pushed a commit that referenced this issue Jan 1, 2024
…ed in a non-serverless environment (#9742)

Closes #9741.

---------

Co-authored-by: Dominic Saadi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants