Going AWS Serverless
If you do a quick Google search, you will get hundreds of definitions of a serverless architecture that all share one common theme, “A way to build and run applications and services without having to manage infrastructure” (Amazon, 2022).
A serverless framework is a means by which you build a tiered architecture. The most common is a three-tiered architecture; the three-tiered architecture usually consists of the following three components:
- Presentation Tier
- Logic Tier
- Data Tier
Within the “tiered” architecture, the concept of serverless has grown to help speed time to market, increase decoupling and decrease cost. The IT industry established common patterns as tiered architectures evolved that led to boilerplate, lightweight servers that run a single piece of software with a single function. Thus, the birth of serverless software such as AWS Lambda.
Suppose you extend this thought just one step further in the evolution. You get to today’s most common and widely used design pattern, event-driven or event-driven architecture. The most understood use or implementation of the serverless framework is, in fact, an event-driven architecture.
In AWS, the Lambda serverless function is a single piece of software. It is frequently used for APIs fired up when it is first called and shut down after a period from its last call. Using serverless software in this manner is an event-driven process. So, let’s look at the most common use cases for Lambda.
AWS now offers a complete line of serverless tools, including their newest implementation of PostgreSQL, Aurora (which also supports the MySQL database), and Fargate, AWS serverless containers. Lambda, however, is most often referred to when discussing AWS serverless. With connections to over 200 other AWS services, there is very little you can’t do with Lambda in AWS. There are some everyday use cases for Lambda. Let’s look at one:
Processing large files, especially images, can be expensive and cumbersome. However, with AWS Lambda, you can create large, parallelized functions that can process the data in pieces or process larger volumes of images at a substantially lower cost. Using the photographer as our example, this photographer wants to upload photographs in near real-time for viewing on the web and mobile devices, even as the wedding is still happening. The photographer can upload pictures to an S3 bucket. This upload triggers a lambda function that runs code to first resize the images for the appropriate size and quality for web and mobile viewing. Once resized, another Lambda function is triggered to move the images to the correct location for viewing on the photographer’s website or mobile application.
Additional processing can happen through this single event, such as facial recognition algorithms used in machine learning. Our photographer is now on the super progressive end of the scale. As the images complete resizing via Lambda, another Lambda is triggered that processes those images through facial recognition algorithms. Using Amazon Kinesis, social media data is stream processed against the facial recognition software to tag those images with participants in the wedding. Those participants, now tagged on the photographer’s social media feed, are notified of being tagged and can see their pictures within minutes.
The options for Lambda utilization or almost endless; entire websites can be run on a Lambda backend, saving customers money and time. Mobile backends can process notifications without specialized software or specialized programming knowledge. Implementors can engineer machine learning and AI in new and creative ways to help businesses be innovative and save money.
The most common concern with Lambda is the conversion of existing software, and the time it takes a serverless function to start processing after some “off time.” Both problems are valid but extremely easy to resolve. Businesses can quickly change from whatever they have to Lambda, one Lambda function at a time. Serverless software does shut down when not used and will start back up when needed. How serverless software behaves saves you money. There are always means unique to your business to work through this so that customers are not affected.