Have you checked out Serverless yet? ⚡
Serverless—you've probably heard about it, know you should check it out, but where do you start? We're building Serverless into our own architecture at Honeybadger, and it's been slow going at times. So much to learn.
The good news is that we made something to help. It's called Honeybadger's Serverless Quickstart, and it's available on GitHub.
Wait, what's Serverless again?
Serverless computing—or Serverless—is a new way to develop web applications and services. Despite the name, Serverless doesn't mean that there are no servers; of course there are servers, you just don't have to manage them yourself.
While the term "Serverless" can be applied pretty broadly, it often refers to the idea of running stateless functions in the cloud, without the need for traditional servers. The cloud providers who manage the infrastructure (read: servers), such as Amazon, Google, and Microsoft, call this "Functions as a Service" (FaaS). That's what we're talking about here.
Serverless functions can be used for a lot of things, from automating routine tasks to replacing the back-ends for client-side and mobile applications. They were best described to me as the "glue" between other managed back-end services like S3, RDS, and Kinesis (these are Amazon examples, but all the major platforms offer similar products).
Here's a typical workflow:
- You upload the function to your FaaS platform (in our case, AWS Lambda)
- A request (or other event, such as a new file on S3) comes in, and gets routed to your function
- AWS executes your function, passing in any data from the event (request parameters, metadata, etc.)
Some functions return a result to the caller (as in an HTTP request), while others just return and exit.
Uploading functions by hand gets old fast, so you'll want to use an automated framework. The most popular framework for building Serverless apps is itself called Serverless Framework. Naming things is hard.
Serverless Framework helps to organize your Serverless functions and deploy them to your preferred FaaS platform—think of it like an adapter to AWS Lambda, Google Cloud Functions, Azure Functions, etc.
Our Serverless Quickstart is built on top of Serverless Framework, and that's where a lot of the magic comes from; for instance, you can deploy the starter Hello World function to your AWS account with `
sls deploy`, and remove it with `
sls remove`—all without leaving your terminal.
Getting started with Serverless
Honeybadger's Serverless Quickstart is a handful of best practices to deploy a Lambda function to AWS using the Serverless Framework. It creates some structure on top of Serverless which you would normally have to discover for yourself. Out of the box, you get:
- A standard directory structure
- Development and production environments
- Unit testing and JS linting
- Optional Honeybadger reporting (duh!)
This is awesome because now you can deploy your first Serverless function to a development environment from a single command, with no risk of taking down your company's Kubernetes cluster or other AWS resources. :)
Serverless is a powerful addition to your toolbox, and it looks great on your resume. If you've never checked it out, block out 10-20 minutes and try deploying the Hello World function to your AWS account.
Co-founder, ⚡ Honeybadger.io