Serverless Computing in AWS

What is serverless computing?
The term "serverless" means that your code runs on a server but you don't need to provision or manage these servers.
In traditional server-based models, developers are responsible for managing servers, virtual machines, and the infrastructure required to run their applications. This comprises activities like load balancing, software installation, scaling, and capacity planning. Developers are now able to run their code in a serverless environment thanks to serverless computing, which abstracts away these infrastructure issues.
In a serverless model, the code is executed in response to specific events or triggers, such as HTTP requests, database updates, file uploads, or scheduled events. When a certain event happens, the cloud provider immediately sets up and grows the computing resources required to run the code. The resources are released after the code has run, and you only pay for the actual execution time and resources used.
Benefits of serverless computing:
With serverless computing, you can focus more on innovating new products and features instead of maintaining servers.
Serverless computing gives the flexibility to scale serverless applications automatically
Serverless computing can adjust the capacity of the application by modifying the units of consumption such as throughput and memory.

Some of the AWS services for serverless computing are:
AWS Lambda: AWS Lambda is a computing service that lets you run your code without provisioning or managing servers. It allows you to execute your code in response to events and automatically scales the infrastructure based on the incoming workload.
Amazon API Gateway: Amazon API Gateway is a fully managed service for creating, deploying, and managing APIs. It integrates well with AWS Lambda, allowing you to build serverless API backends. You can define API endpoints and configure them to trigger specific Lambda functions.
Amazon DynamoDB: Amazon DynamoDB is a fully managed NoSQL database service. It can trigger AWS Lambda functions in response to changes in the database. This enables real-time applications that react to database updates without the need for manual triggers or polling.
Amazon S3: Amazon Simple Storage Service (S3) is a scalable object storage service. It can generate events when specific actions occur, such as an object being created, updated, or deleted. These events can trigger AWS Lambda functions to process the data stored in S3.
Amazon SNS: Amazon Simple Notification Service (SNS) is a fully managed messaging service. It allows you to send notifications to various endpoints, including AWS Lambda functions. SNS can be used to decouple the components of your application and trigger serverless functions based on events.
Amazon EventBridge: Amazon EventBridge is an event bus service that makes it easy to connect different AWS services and your own applications. It allows you to route events from various sources to targets such as AWS Lambda functions. EventBridge simplifies the creation of event-driven architectures.
AWS Step Functions: AWS Step Functions is a serverless workflow service that enables you to coordinate and visualize multiple AWS Lambda functions as a workflow. It provides a visual interface to define and manage the flow of your application, making it easier to handle complex business processes.
AWS AppSync: AWS AppSync is a fully managed service that simplifies the development of GraphQL APIs. It integrates with various data sources, including AWS Lambda, to provide real-time data synchronization and offline capabilities in your applications.
AWS Lambda:
AWS Amazon Web Services (AWS) offers the serverless computing service known as Lambda. It allows programmers to run their programs without having to set up or maintain servers. Developers may concentrate on creating the application logic using Lambda while leaving the infrastructure up to AWS.
You may use Lambda to create programs in well-known programming languages like Node.js, Python, Java, C#, and Go. You may submit your code to Lambda, which will then take care of scaling and managing execution based on incoming events or triggers. These events may originate from several sources, including HTTP requests, data updates in Amazon S3 or DynamoDB, or planned events from Amazon CloudWatch.
The capacity of Lambda to automatically scale is one of its main advantages. Lambda allocates extra computational resources as the workload grows to accommodate the new requests. To save expenses as the workload reduces, Lambda dials back the resources. It is a cost-effective approach since with this flexibility, you only pay for the real compute time that your code uses.
You may create intricate, event-driven structures using Lambda's seamless integration with other AWS services. Lambda, for instance, may be used in conjunction with Amazon API Gateway to build serverless APIs or with Amazon S3 to automatically process and modify data.
Through Amazon CloudWatch, AWS Lambda offers monitoring and logging features that let you keep tabs on the performance of your functions and create alerts.
How AWS Lambda works?
You upload your code to lambda.
you set your code to trigger from an event source, such as AWS services, mobile applications, or HTTP endpoints.
Lambda runs your code only when triggered.
You only pay for the compute time that you use.
For example:
Let's consider you want to resize an image, so you upload images that you want to resize. you pay only for the computing time that you use when uploading new images. Uploading the images triggers Lambda to run code for the image resizing function.
