The Pros and Cons of AWS Serverless Express

The Pros and Cons of AWS Serverless Express

aws-serverless-express is a NodeJS-based API framework used for mimicking the routing capabilities of ExpressJS framework inside Lambda functions. This article aims to explain the pros & cons of using this library. Well if I manage to identify your probable identity, you came to the right place as this article intends to showcase the good and bad things about AWS serverless express framework from an architect’s point of view.

Image for post

Is aws-serverless-express good or bad for your application’s migration use-case?

aws-serverless-express is a NodeJS-based API framework used for mimicking the routing capabilities of ExpressJS framework inside Lambda functions. This article aims to explain the pros & cons of using this library.

Getting Started!

You are probably here because:

  • You are a NodeJS developer
  • You’ve used Express as your API framework
  • You are looking into migrating API workloads towards a serverless-based architecture
  • You are looking into getting started quickly with AWS Lambda but somehow overloaded by new concepts and would like to utilize this framework.

Well if I manage to identify your probable identity, you came to the right place as this article intends to showcase the good and bad things about AWS serverless express framework from an architect’s point of view.

Differences of Serverless Express & Class ExpressJS

Image for post

Knowing the differences between lambda-based and classic express helps in assessing the value that they offer to your architecture

In order for us to give a fair assessment of the pros & cons of aws-serverless-express, we have to understand the critical differences between the classic and lambda-based express frameworks.

Critical Differences

Image for post

Understanding differences between the frameworks’ hosting environments will help you get a better understanding of the premises mentioned later in the article

Hosting Environments

aws-serverless-express is meant to run inside Lambda Functions, while the classic ExpressJS is expected to run inside virtual machines or Docker containers. This means that the serverless-based express is not capable of retaining any form of state due to the random execution location of Lambda-functions between a region’s availability zones.

This also means that the lambda-based framework can be cheaper and more scalable and it offers you more efficiency compared to the traditional one.

Image for post

Application state plays a critical role on authenticating and authorising HTTP request on APIs.

State Management

aws-serverless-express does not manage state because its meant to run across different underlying lambda functions. This means that any form of attempt to store session-related state inside the API instance will cause failures as lambda functions tend to evaporate after 15 minutes of idle compute time.

aws nodejs expressjs programming aws-lambda amazon web services

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

What is AWS Lambda? Introduction to AWS Lambda on Amazon Web Services

What is AWS Lambda? Introduction to AWS Lambda on Amazon Web Services. Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform, offering over 175 fully-featured services from data centers globally. Millions of customers—including the fastest-growing startups, largest enterprises, and leading government agencies—are using AWS to lower costs, become more agile, and innovate faster.

Sending Email using AWS Lambda and Amazon SES

In this article, we’ll discuss the procedure to build a Lambda function that will send an email to the specified recipient from the specified sender using Amazon Simple Email Service (SES). In this project, we’ll do everything in AWS console.

Invoke AWS Lambda with Another Lambda Function with Nodejs

In this article, I will show you how to invoke a lambda function from another lambda function.

Infrastructure as Code on Amazon Web Services (AWS)

How to Build and Manage Infrastructure as Code with Amazon Web Services - AWS CloudFormation, AWS CloudWatch and Amazon EC2

An Introduction to Infrastructures for WEB projects in AWS

An Introduction to Infrastructures for WEB projects in AWS - Let's review a particular project in detail and the cost of infrastructure maintenance. And so, we have an internal WEB application that consists of a static website on React, a backend on Go, and a database DynamoDB. All code is stored on Github and for CI/CD we use Github Actions. The infrastructure code is defined in Terraform.