How to create a serverless website with AWS Lambda

Facebook
X
LinkedIn

Learn how to put together a serverless Lambda web app using API Gateway, DynamoDB, and S3

There’s a lot of AWS talent in the Baltimore area, but it can be tough driving down to NoVa to attend AWS meetups. So we decided to start the Columbia AWS Meetup. And to kick off our first event, our VP of Software Development Dan Rusk covers how to create a serverless stack with Lambda. What we mean by “serverless” is that you can set up your app architecture without standing up any EC2 instances. This gives you two benefits:
  1. You don’t have to pay for idle server uptime.
  2. Your app is elastic, meaning it can automatically scale up and down with spiky traffic. So you only pay for what you use.
The sample app in the presentation is a simple voting website. As a user, you pick a presidential candidate on a form. The results are tallied on the bottom. demo serverless voting app website The app architecture leverages a few AWS managed services. Managed services help you reduce cost and maintenance.
  • API Gateway: This creates a POST endpoint for user votes, and forwards an event to Lambda.
  • Lambda: These are scalable containers for the app. There are two Lambda functions: Function 1: Updates the database with a user’s vote Function 2: Updates the website with the latest results
  • DynamoDB: The data is stored in a managed NoSQL database.
  • S3: HTML/CSS/JS files are hosted as a website. A JSON file on S3 caches the latest tallies, which reduces the number of calls to DynamoDB.
voting app serverless architecture You can watch the recorded presentation on YouTube. You can also check out the slide deck here:
Create a Website and API with AWS Lambda from Daniel Rusk
Here’s the sample code and the live demo site in action. This is a good opportunity to get some hands-on experience integrating several AWS services. You don’t need any experience with Node.js or React in order to follow along. If you’re in the Columbia/Baltimore area, we encourage you to come to one of our AWS meetups — we have food and drinks. Otherwise, keep an eye out for more recorded presentations in future posts. Got any tips for using AWS Lambda? Have any suggestions for future topics? Feel free to add your thoughts to the comments. 

Like this post? Please share it using the share buttons to the left. Then join our mailing list below and follow us on Twitter – @thorntech – for future updates.

Related Posts

Try SFTP Gateway Free for 14 Days — No Server to Stand Up, No Credit Card

Trying self-hosted software normally costs you an afternoon before you’ve even decided you want it. Spin up a VM, open the right ports, work through the marketplace listing’s prerequisites, and hope the image boots the way the documentation says it will. That setup tax is

SFTP Gateway 3.9: More Control, Better Performance

A client opens an SFTP connection and never lets go. Maybe it’s a scheduled job that lost its network path mid-transfer, maybe it’s a misconfigured script retrying without backing off; either way, the connection sits open, holding a slot on your server indefinitely. Multiply that

Introducing the SFTP Gateway Product Support Lifecycle

SFTP Gateway now publishes a written Product Support Lifecycle and a Version Support Calendar for every cloud marketplace, so you always know exactly how long your version stays patched, and when. Thorn Technologies is introducing the SFTP Gateway Product Support Lifecycle: a written commitment to