-
Serverless is a generic term kind of refer to as a FaaS (Functions as a Service) in case of AWS it’s Lambda
-
You maybe have heard of Lambdalith architecture, it’s just nothing but bunch of lambda functions in the backend coupled with AWS API Gateway and other services we have on Amazon.
-
There is a framework as well with the same name serverless, It’s also provides the same concept but on top of AWS so you don’t have to deal with underlying infrastructure. It’s similar to sst, terraform or pulumi, basically IaaC (Infrastructure as a Code), who knows how many tools are out there kind of like these.
-
As I said Serverless is a generic term that doesn’t couple with AWS only but Functions as a service provided on Azure as well using Azure Functions or on GCP.
-
Main concept here is that your simple logic stays in a single lambda function and you can scale that lambda to serve your users.
Two different ways t execute lambda functions
- Synchronous → call lambda and wait for the response (commonly used as API)
- Asynchronous → kind of like Fire and Forgot, for events like Update S3, Send Email
Lambda can be triggered using events, and there are multiple Event types on AWS that lambda supports like
- Code Commit
- API Gateway Authorizer
- SES Email Receiving
- Cloudwatch Logs … and list goes on
Now I have personal experience with serverless framework and it’s syntax is also pretty intuitive as how lambda being used, it’s like you define a function in a Yaml file and you attach a event to that function and you can deploy your lambda serverless handles the creation of Cloud Formation stack and everything behind the scene for you.