5 More Killer Use Cases for AWS Lambda
In case you had any doubts about AWS Lambda’s place in the world of cloud computing, the year 2017 should have made it clear that Lambda is here to stay. We already looked at 5 Killer Use Cases for AWS Lambda in a previous blog but, to prove the point, in this post we'll take a look at several more killer use cases that you may not have heard of—the kind that have helped to put AWS Lambda squarely on the map.
AWS Lambda: The Basics
First, though, a quick recap. AWS Lambda is Amazon Web Services' serverless deployment platform. What does that mean? You can use Lambda to run a program in the AWS cloud environment with virtually no overhead. You simply write the code, send it to Lambda, and it's there for you to use. If you have a website, an application, or a full suite of applications and services running on AWS, you can use that code to perform tasks that might otherwise take up too much time or resources.
Behind the Scenes
How does AWS Lambda do this? When you send your code to Lambda, you are actually deploying it in a container. The container, however, is itself created, deployed, and managed entirely by AWS. You do not need to be involved in the creation or management of the container, and in fact, you do not have access to any of the infrastructure resources that might allow you to take control of it. The container is simply a location for your code.
The lack of infrastructure access, however, is not a drawback. In fact, it is one of the major advantages of AWS Lambda. You don't need to worry about the nuts and bolts of deployment, or other infrastructure overhead, because it's all taken care of. Instead, you can concentrate on writing and using your code.
A Wide Range of Uses
AWS Lambda is not designed for every kind of use. You would not want to use it, for example, for anything that you need to control or manage at the infrastructure level, and you would not want to use it for a large application or suite of applications.
Lambda is ideal for services that can run in the background, but which might otherwise tie up needed resources. It can be used for highly repetitive tasks, or for tasks which require a much larger than usual amount of time for each item being processed.
Start your Serverless journey today!
Download our free guide: Intro to Serverless computing with AWS Lambda
What kind of tasks are we talking about? Consider the following:
1. Backend Cleaning
One of the top priorities for any consumer-oriented website is a rapid response time. A slow response, or even a visible delay in responding, can translate into a significant loss of traffic. If your site is too busy taking care of background tasks to quickly display the next page, or to show search results, many consumers may simply switch to another site that promises to deliver the same kinds of information or services. You may not be able to do much about some sources of delay, such as slow ISPs, but there are things that you can do to speed up response time on your end.
Where does AWS Lambda come in? Backend tasks should not be a source of delay in responding to frontend requests. If you need to parse user input in order to store it to a database, or if there are other input-processing tasks which are not necessary for rendering the next page, you can send the data to an AWS Lambda process, which can in turn not only clean up that data, but also send it on to the database or application that will use it.
2. Predictive Page Rendering
You can use AWS Lambda to do more than just clean up data, however. If you are using predictive page rendering to prepare webpages for display based on the likelihood that the user will select them, AWS Lambda can play a major supporting role.
You can, for example, use a Lambda-based application to retrieve documents and multimedia files, which may be used by the next page requested, and to perform the initial stages of rendering them for display. If multimedia files are being served by an external source, such as YouTube, the Lambda application can check for their availability, and attempt to use alternate sources if they are not available.
3. Bulk Real-Time Data Processing
It isn't unusual for an application, or even a website, to handle a certain amount of real-time data. Data can stream in from communication devices, from peripherals interacting with the physical world, or from user input devices. In most cases, this data is likely to arrive in short bursts, or even a few bytes at a time, in formats that can be easily parsed. There are times, however, when your application may need to handle large volumes of streaming input data, and moving that data to temporary storage for later processing may not be an adequate solution.
You may need, for example, to pick out specific values in a rapid stream of data from a remote telemetry device, as it is coming in. If you send the data stream to an AWS Lambda application designed to quickly pull and process the required information, you can handle the necessary real-time tasks without slowing down your main application.
4. Dealing with External Services
If your website or application needs to request services from an external provider, there's generally no reason why the code for the site or the main application needs to handle the details of the request and the response. In fact, waiting for a response from an external source is one of the main causes of slowdowns in web-based services.
If you hand requests for such things as credit authorization or inventory checks to an application running on AWS Lambda, your main program can continue with other elements of the transaction while it waits for a response from the Lambda program. This means that in many cases, a slow response from the provider may not be apparent to your customers, since they will see the transaction proceeding, with the required data arriving and being processed before it closes.
5. Rapid Document Conversion
If you are providing documents (for example, specifications, manuals, or transaction records) to your users, they may not always want them in one standard format. While many users may be happy with an HTML page, others may want to download a PDF, or may need the document in a more specialised format.
You could, of course, store copies of each document in all formats that are likely to be requested. But storing static documents can take up a considerable amount of space, and it is not practical when the content of the documents changes frequently, or in response to user inputs. It is often much easier to generate the documents on the fly. This is exactly the kind of task that an AWS Lambda application can handle rapidly and easily—retrieving the required content, formatting and converting it, and serving it either for display in a webpage, or for download.
Why Lambda Is So Useful
AWS Lambda can and should be one of your main go-to resources for handling repetitive or time-consuming tasks, along with the other heavy-lifting jobs of the data-processing world. It frees your main online services to focus on high-priority frontend tasks, such as responding rapidly to user requests, and it allows you to offload many processes that would otherwise slow down your system.