<div style="text-align: justify;"> # AWS Lambda use cases AWS Lambda has over 100,000 monthly active users, does billions of monthly executions, and is available in 22 worldwide locations. Many organizations have chosen to use the Function-as-a-Service (FaaS) model to enhance their business operations while saving both time and money. AWS Lambda has a variety of fascinating use cases, and few of them will be briefly covered in this chapter. ### Mass Emailing Each year, many huge corporations, for example, *The New York Times*, must send billions of transactional emails, as well as newsletters, and other publications. Mass emailing demands technological skill and is highly expensive, but it has become a vital aspect of any marketing campaign. Simple Email Service (SES) and AWS Lambda can work together to provide a cost-effective email flow, while the email list is safely stored in Simple Storage Service (S3). General steps are: 1. Upload CSV file 2. A CSV file is a trigger for an S3 event 3. That S3 event invokes a Lambda Function 4. Lambda function adds the CSV file to DynamoDB database 5. Same lambda function sends emails to the newly added email addresses ### Real-time notifications Amazon Simple Notification Service (Amazon SNS) is a fully managed messaging service for both application-to-application (A2A) and application-to-person (A2P) communication. [reference](https://aws.amazon.com/sns/?whats-new-cards.sort-by=item.additionalFields.postDateTime&whats-new-cards.sort-order=desc) SNS is in charge of topic development and determining which subscribers will be notified. The Lambda functions that have been assigned to the message can modify it and publish it. ### Real-time data processing Another use case for AWS Lambda is analyzing data metrics in order to analyze data in real time and respond to it. The data from the website is captured using Amazon Kinesis Stream, while Lambda automatically grows the number of functions to meet the stream. The stream-based architecture may be used to manage a company's data sources throughout its website. These data sources give information to a stream, which runs a Lambda function. Otherwise, it is possible to manually invoke the functions with the RequestResponse type. Kinesis and Lambda may be ideal for a company if it has a website or application that requires real-time processing of massive amounts of data. Other advantages include the ability to test new features and keep track of consumer satisfaction. ### Alexa Alexa, a well-known virtual assistant, converts human voice into a programming action. A simple function may be written to invoke a Lambda response; for example, Alexa can locate the nearest coffee store. Alexa can perform the following tasks: - the Skill Handler Function offers the custom logic that must be run to fulfill the demands of the user - interactions with third-party services, such as databases, are ensured by third-party functions - as a result of the voice command, the handler function is triggered by Custom Alexa Skill Set ### Image recognition engine Another use case for serverless Lambda is keeping track of a high number of picture uploads. Several workflows can be developed to handle it more effectively, with one workflow executing the next. The following is how it works: 1. the data extraction from the picture is the initial function 2. then the item in the image is identified 3. the following function will then create a thumbnail and return to the database This is only an example; the pattern can be customized to match specific objectives. It is possible, for example, to crop the photos automatically in order to identify the primary subject. ### Building a serverless website Businesses have been able to focus resources and attention on their key capabilities and duties by avoiding the maintenance of servers, including virtual servers. Developers may focus on the real product instead of dealing with the day-to-day details of server management. AWS Lambda, in conjunction with DynamoDB, Amazon S3, and Amazon Cognito, enables them to create a website or application without having to manage servers or operating systems. 1. AWS S3 is used to host website content 2. DynamoDB is used as a noSQL database 3. Amazon Cognito handles user authentication and administrative chores 4. AWS Lambda develops database-accessing functions Companies can create an e-commerce website that fits almost all of its needs. Payments, carts, and developing an engine are all examples of Amazon Lambda use cases. In preference, two Lambda functions could be used to create a dynamic web page and prevent losing data due to, for example, EC2 termination. ### Authentication The customisation of the authentication process is handled by Amazon Cognito in conjunction with AWS Lambda. Even in business, we are moving toward more personalized and individual communication. Lambda function can be linked to the following triggering sources: - sign-up and sign-in (to guarantee the right set of questions is asked) - authentication challenge (to keep the sign-in process secure) - custom message (to respond to a specific inquiries and requests quickly), etc. Amazon Cognito, for example, will check with the Lambda function before sending a customer a confirmation email, allowing organization or developers to customise the phrasing and make it more helpful. A request for a new password or crucial contact information, as well as a letter of confirmation, are frequent triggers. ### Text-to-speech Amazon Polly, when used in conjunction with Lambda, enhances AWS Lambda use cases by synthesizing speech and assuring faster reaction times, which is critical in real-time communication. 1. new file in S3 executes a Lambda function 2. The Lambda function then starts an MP3 generating process 3. It also stores the copy of the data in the database 4. The conversion of the text into an audio file is carried out by the second Lambda function [reference for all use cases above](https://www.techmagic.co/blog/14-use-cases-for-aws-lambda-how-to-make-the-most-of-it/) ### Converting document formats When a corporation provides documents (specifications, manuals, and so on) to its consumers via a website, they may not necessarily be expected to be in a single format. While many people may be OK with an HTML page, some may want to download a PDF or require a more specialized format. Storing static documents takes up a lot of space, and it's not practicable if the documents' content changes regularly or in reaction to user inputs. It is frequently far more convenient to create files on the fly. This is exactly the type of activity that an AWS Lambda application can do quickly and easily: obtaining the relevant content, formatting and converting it, and providing it for display on a webpage or download. ### Rendering predictive pages AWS Lambda can assist a corporation that uses predictive page rendering to prepare webpages for display based on the likelihood that the user will pick them. It's possible to utilize a Lambda-based application to retrieve documents and multimedia assets that could be used by the next page requested, as well as to execute the first phases of rendering them for display. If multimedia files are delivered by an external source, such as YouTube, the Lambda application can examine availability and seek to use other sources if necessary. ### Automating backups and everyday tasks AWS accounts benefit from scheduled Lambda events for maintenance. Using the boto3 Python libraries and hosted on AWS Lambda, you can quickly create backups, check for idle resources, generate reports, and do other common activities. ### Backend cleaning A quick response time is one of the top requirements for any consumer-oriented website. A late response, or simply an apparent delay in response, might result in considerable traffic loss. Backend tasks should not cause frontend queries to take longer to reply to. If you need to parse user input before storing it in a database, or if you need to perform other input-processing tasks that aren't required for rendering the next page, the data could be sent to an AWS Lambda process, which can then clean it up and send it to the database or application that will use it. [reference for the last 4 use cases](https://www.contino.io/insights/aws-lambda-use-cases) </div>