easy-easier-easiest-lambdas

Quickstarts for AWS Lambda (“serverless”) functions in React, with and without AWS tooling. Functions connect to a serverless Apache Cassandra database.

View the Project on GitHub januff/easy-easier-easiest-lambdas

AWS Lambdas: Easy, Easier, Easiest 🍳

Step-by-step serverless functions using Amplify, Netlify, and/or Vercel.

“Where AWS becomes overkill are typical JAMstack apps. A static site with lots of frontend logic. Hosting those on AWS is a pain whereas Netlify and Vercel make them a core feature.” -Swizec Teller, AWS, Vercel, Netlify, or Firebase? (Serverless Handbook, Feb 2021)

Back in the day, using AWS Lambdas in your Jamstack app could be a pain indeed (eg. for me, last year.) But these days Amazon’s Amplify CLI has greatly simplified Lambda configuration, while Netlify and Vercel offer workflows that make Lambda setup even simpler.

This repo collects step-by-step deployment instructions for all three platforms. Where the steps occur on a web dashboard or a CLI, I’ve included screencast GIFs to illustrate the interaction. (In a companion essay on Medium, I appraise the platforms for a comic book translation app I’m developing.)

AWS Lambda Quickstarts ⏲️

Amplify CLI With Create React App

📔 Amplify Step-by-Step ➡️

đź“– Official Amplify Docs: Functions Overview

Netlify With Create React App

📔 Netlify Step-by-Step ➡️

đź“– Official Netlify Docs: Netlify Functions

Vercel With Next.js

📔 Vercel Step-by-Step ➡️

đź“– Official Vercel Docs: Serverless Functions

Apache Cassandra-as-a-Service 👩‍🚀

The database package in the installation and authentication steps is DataStax’s @astra/collections JavaScript library, which I’m using to connect to a Cassandra NoSQL database, newly accessible as a pay-as-you-go serverless resource. (Free DataStax account required.)

📔 Astra Step-by-Step ➡️

Some Helpful Explanations đź’¬

for SERVERLESS

“You can use Serverless Functions to solve (almost) any backend needs you have without deploying and maintaining a server yourself.” -James Q. Quick, Serverless Functions, Netlify vs Vercel, and the Jamstack (YouTube, Dec 10 2020)

[+]

“When serverless started, it was about making the lives of backend developers easier. As it’s progressing, we’re seeing more frontend focused teams using serverless to build APIs and access data that wasn’t easily accessible. Serverless is going mainstream.” -Matt Biilmann, Interview with Matt Biilmann, CEO and co-founder, Netlify (Jaxenter, Feb 16 2021)

for JAMSTACK

“For static content, everything is prebuilt and cached. For dynamic content, companies build microservices that are loaded on demand and that can scale easily.” -Romain Dillet, Cloudflare is testing a Netlify competitor to host Jamstack sites (TechCrunch, Dec 7 2020)

“You effectively remove the performance tradeoff of serverless because static elements of the website are pre-rendered, and then a serverless backend is delivered either via APIs or right from the network edge in response to request/response logic.” -Matt Biilmann, Interview with Matt Biilmann, CEO and co-founder, Netlify (Jaxenter, Feb 16 2021)

for VERCEL

“Unlike Netlify, Vercel simplifies its serverless function signature by only accepting requests and responses as parameters, which is achieved by wrapping the original AWS Lambda environment and simplifying it only for serving content purposes. Brilliant idea!” -Emrah Samdan, Why do companies invent their own serverless functions? (Thundra Blog, Jul 2020)