In the previous article, we learned what is Serverless and now we will go one step further and look at the AWS Lamda service which helps us on using the Serverless function.
So, let's get started...
Check the previous article, What Is Serverless? A Beginners Guide
What is AWS Lamda?
AWS lambda is how you go serverless, in which you can execute your code.
With using AWS lambda, you are no longer required to create EC2 instances, manage VMs, consider load balancing, or be concerned with scaling and monitoring.
In AWS, they are known as lambda functions and in Google Cloud, they are called Cloud Functions.
Advantages of AWS Lamda function:
There are some good benefits of using AWS lambda, like:
- Invoke your Code on an API call
- Saves Cost as its runs on Demand
- Scaling is Automated
- Monitoring is Easy with CloudWatch
- Concurrent Execution as per requests
- You can integrate with other services of AWS for its invocation like S3, SQS, DB
Runs on Demand:
As opposed to EC2 VM Instances, which run continually, it only runs when called upon, which helps in saving money.
What we can Build with AWS lambda?
- Web Application/Its Backend Services
- Cron Jobs (Batch or Data Processing)
- Real-Time Processing Application/File Processing
- Security Authentication APP
- Multiplayer Games
AWS Lambda Pricing:
The pricing of AWS lambda functions depends on their uses and some criteria, like:
1) Number of requests/Duration it runs
2) Amount of memory allocated to your function while creating along corresponding CPU power and other resources are allocated
The Duration is calculated from the time your code begins execution until it returns or otherwise invocation timeout/terminates
Free Tier includes 1M free requests per month and 400,000 GB seconds of computing time per month.
Not just AWS Lamda, there are some services like storage, Database, Messaging & gateway that are Serverless in AWS.