Member-only story
Write Your First Serverless Application With AWS Lambda
A hands-on guide to setting up your first serverless application
Serverless applications are gaining popularity lately. Let’s go through the basics and learn to set up your own serverless application within minutes.
In this guide, we will look at the core concepts of serverless applications and build one using AWS Lambda. This guide will not teach you how to program, or how to write SQL, instead, it focuses solely on teaching you how to use and write serverless applications to your benefit.
Note, this guide will require an AWS account for setting up a serverless lambda. If you don’t have an AWS account, you can follow until the end, where we showcase how to run serverless applications locally.
What is a Serverless Application?
How can my code run without a server? While we call it serverless, it’s not entirely serverless. Serverless means, your application’s code is set up to be called at a point in time, and it will only run until it has completed. For AWS, you pay for each millisecond of processing time.
So does it not run on a server? Well, it does technically run on an infrastructure set up by your cloud provider, for example, AWS. They have an infrastructure set up, and whenever you call your application’s endpoint, AWS will fetch your code and run it on their server. Once it has completed, the execution stops.
You will also find serverless applications to be called FaaS, Function as a Service because with serverless applications, you manage functions instead of servers.
Why Go Serverless?
There are multiple reasons why one would want to follow the serverless route. First of all, smaller sized application libraries are easier to maintain, and even faster to ship. There are fewer dependencies and developers do not need to be as afraid of breaking existing functionalities.
Since you do not need to manage the infrastructure and servers, you do not need to worry about scaling, the cloud provider will handle this.
A per millisecond billing granularity makes it perfect for those applications which are…