Creating serverless APIs with AWS Lambda and API Gateway
Published by O'Reilly Media, Inc.
Save time and money by serving API calls with on-demand computing
In many projects, it’s natural to put the responsibility of responding to API calls, with their highly variable computing needs, on the same infrastructure that serves web pages and assets, but you can save both time and money by serving API calls with on-demand computing.
Join Bill Boulden to explore a serverless architecture that removes load from web servers and keeps you from paying for an instant of wasted idle time—all while scaling flawlessly to handle any volume. Over three hours, using a combination of lectures and hands-on exercises, Bill highlights the benefits of serverless architectures compared to traditional API server fleets and walks you through creating a functioning serverless API—using Amazon API Gateway to route calls to AWS Lambda for on-demand, pay-by-the-millisecond execution—that coexists alongside conventionally served web pages.
What you’ll learn and how you can apply it
By the end of this live online course, you’ll understand:
- On-demand computing basic concepts and benefits
- How API Gateway and AWS Lambda interact and how to use them together
- What extra context and objects are used to interact with the AWS Lambda environment
- The advantages of serverless architectures compared to traditional API server fleets, autoscaled or not
- When serverless APIs make sense (and when they don't)
And you’ll be able to:
- Upload and update functions in AWS Lambda
- Interpret RESTful API requests and serve responses from AWS Lambda
- Create and manage an API gateway
- Configure an API gateway to answer HTTP requests
This live event is for you because...
- You’re an experienced Node.js or Python developer who wants to start serving requests as a service.
- You’re an infrastructure or API architect interested in saving money on server fleets.
- You expect your application to scale rapidly in the near future, and you want your API to stay available regardless of load.
Prerequisites
- Intermediate proficiency or higher in Node.js (The course will be taught in Node.js)
- A basic understanding of HTML5 and JavaScript in the DOM (e.g., how to manipulate a simple form on a web page), domain names, and relational databases
- Familiarity with API concepts such as statelessness and RESTfulness
Required materials and setup:
- A machine with a bash or POSIX-like command line and the AWS Command Line Interface tools installed
- A paid AWS account (Costs will be miniscule—in the single digit cents—but many AWS Lambda and API Gateway features are not available on the free tier.)
- AWS Command Line already installed for the session
Recommended preparation:
Getting Started with Node.js (video)
Schedule
The time frames are only estimates and may vary according to how the class is progressing.
Introduction (10 minutes)
- Lecture: Defining key concepts, including API, RESTFulness, and statelessness
On-demand computing as a service(25 minutes)
- Lecture: Overview of on-demand computing as a service; how it helps create a serverless API; the bare minimum knowledge of AWS Lambda needed to get a "Hello, World" request/response running
- Hands-on exercises: Walk through a “Hello, World” example; use the UI to upload a simple lambda function
Amazon API Gateway (25 minutes)
- Lecture: Overview of API Gateway; how it helps create a serverless API; the bare minimum knowledge of API Gateway needed to make the simplest possible API gateway
- Hands-on exercises: Walk through a “Hello, World” example; use the UI to connect the "Hello, World" to an API gateway
Break (10 minutes)
- Implementing an API function in practice (30 minutes)
- Hands-on exercises: Download a static HTML file representing a client-side rendered page you'll be hooking up to a serverless API; describe the needs of the API function; write the API function; hook up the API function to an API gateway
- Q&A
Business implications of serverless APIs (20 minutes)
- Lecture: The API jobs best and least suited for serverless computing; how to find opportunities in your day-to-day work to use these techniques most effectively
- Q&A
Break (10 minutes)
Next steps for creating serverless APIs (20 minutes)
- Lecture: Introduction to the Serverless Framework; putting an API gateway behind CloudFront; putting an API gateway under a Route 53 domain name; using CloudWatch to pull advanced server metrics
Wrap-up and Q&A (30 minutes)
Your Instructor
Bill Boulden
Bill Boulden is CTO at FavorDrop in Buffalo. As a software engineer for 25 years, they’ve taken part in over 25 distinct software launches—every last one of them on AWS. As a fractional CTO, Bill repeatedly built and launched startup MVPs for angel-stage founders, with three exits and roughly half of the startups still alive. Now they’re a TechStars All-Star Mentor and an eight-time mentor formerly with Techstars Atlanta and now Techstars Columbus. In their spare time they produce all genres of music under the artist name “Downupright.”