Search code examples
node.jsexpressserverlessaws-serverless

Native Serverless vs Serverless Express


Right now, I am following a guide prepared from Serverless Stack Team. They are using React and lots of AWS features like lambda and API getaway. In order to practice it, I am re-writing one of my old Express example with the Serverless stack.

I also saw a library or tool called aws-serverless-express. This library or tool allows you to run your express app in a way that serverless form.

It will be a weird question, but I was wondering the difference between native serverless build and serverless express.

Cold start already disadvantages. I am aware of it. Other than this, what will be the negative or positive sides of serverless express?
what will be the negative or positive sides of native serverless?


Solution

  • Disadvantages of serverless express:

    1. Possible additional cold start time caused by these extra dependencies
    2. Not being able to have separate granular permissions per route (e.g. one route accessing S3 and another accessing DynamoDB)

    Advantages:

    1. Less boilerplate
    2. Avoiding resources limits in CloudFormation stacks

    More information:

    https://github.com/jeremydaly/lambda-api#why-another-web-framework

    https://www.jeremydaly.com/build-serverless-api-serverless-aws-lambda-lambda-api/#comment-19036