• r

    rp

    1 year ago
    @User ^
  • taijuten

    taijuten

    1 year ago
    amazing, thank you again @User
  • r

    rp

    1 year ago
    One annoying part about using us with AWS lambda is that each lambda function would need to be an express app (as shown in the docs).. not sure if you would be OK with that. But we are working on making the node SDK independent of express and would be able to support AWS lambda's context object natively. But that will take a few days to 2 weeks maybe to launch.
  • taijuten

    taijuten

    1 year ago
    yeah, I was just looking at the
    supertokens-node
    repo, wondering how much effort it would be to make a
    supertokens-serverless
    fork, without express, and including a Cloudformation with APIGateway or similar to replace the express aspect of it. Alternatively, I think actually the entire supertokens backend might even be able to sit in a Lambda Layer, so that each Lambda execution should already be initialised beforehand, based on environment variables. This would drastically reduce the cold-start time, if each API endpoint on the backend was an independent lambda
  • taijuten

    taijuten

    1 year ago
    doing so might allow you to put ST on the AWS Marketplace, giving an extra source of revenue, perhaps
  • r

    rp

    1 year ago
    So have a look at this: https://github.com/supertokens/supertokens-node/blob/req-res-wrapper/lib/ts/framework/awsLambda/framework.ts It's the release we will be doing very soon. In this, the actual core logic uses an abstract request / response class, and we implement this class for AWS lambda / express etc.. The above link is for AWS lambda.
  • taijuten

    taijuten

    1 year ago
    oh nice!
  • r

    rp

    1 year ago
    Alternatively, I think actually the entire supertokens backend might even be able to sit in a Lambda Layer You mean the core and the backend SDK stuff? Or just the backend SDK stuff?
  • taijuten

    taijuten

    1 year ago
    I think the backend SDK would sit on that. Not sure of the best way to get the core serverless, though. Most of the devs at my workplace are Java devs too, and we're migrating to a serverless architecture. Lambda etc supports Java, but the cold start times on many applications can be debilitating. We have a Proof of Concept lined up to try https://quarkus.io/guides/amazon-lambda for some Java, to see if that helps, but we haven't got any results on that yet
  • r

    rp

    1 year ago
    I see. So you can give us a shot for now with the express style lambda function (I know, it's not ideal..), and if you like it, when we release the new SDK version, you can move to that 🙂