November 26, 2021

What is serverless computing with the example of AWS Lambda?

AuthorAna Novokmet

The cloud market is growing steadily and offers customers a wide range of different services and options. Alongside other cloud computing models, such as Platform-as-a-Service (PaaS), Infrastructure-as-a-Service (IaaS) and Software-as-a-Service (SaaS), the Function-as-a-Service (FaaS) concept is probably the best known. FaaS is also referred to as serverless computing. Our blog article "A look behind the scenes - cloud services" briefly explains these terms.

But what is behind the term serverless computing and what are the uses? Our blog post not only answers these questions, but also highlights a specific use case of serverless computing using AWS Lambda as an example. This platform offers the possibility to run code without an infrastructure in the form of a server or cluster.

What is serverless computing and why is it used?

Serverless computing describes the practice of offering backend services on a per-use basis, implying that applications are started only when they're needed. The main advantage of this model is that developers don't have to worry about the underlying infrastructure; instead, they can concentrate on defining logic, writing code, and deploying it while the serverless provider handles the rest. To be more precise, the cloud provider is in charge of managing the cloud infrastructure as well as application scaling, which includes operating system and file system administration. The provider’s responsibility also involves security patching, load balancing, capacity management, scaling, logging, and monitoring. (Source)

What are the benefits of serverless computing in general?

In general, serverless computing has various advantages; it is often extremely cost-effective since consumers do not have to pay for any unused resources such as space or idle CPU time. Furthermore, application scaling is trivial together with writing backend code and functions that each perform a specific purpose. It may be possible to release an app to the market faster and make code changes without causing issues or taking a long period of time. (Source)

What is AWS Lambda?

Although serverless and Function-as-a-Service (FaaS) terms are often considered synonyms, FaaS is in fact a subset of serverless as it is mostly focused on the event-driven computing paradigm. (Source)

AWS offers an FaaS solution called AWS Lambda that allows users to execute code without having to setup or manage servers. It is a serverless and event-driven platform that offers paying only for what is being used, or, to put it in other words, paying for the consumed computing time. A lambda, in general, is a short, straightforward block of code or a function that can return a result and perform any kind of computing task. AWS Lambda supports various programming languages, including Java, Go, Python, Node.js, PowerShell, and others, and allows you to develop and publish code as a container image file. (Source)

There are a few typical steps to follow while developing and running Lambda code:

Step 1: Uploading the code to AWS Lambda
Step 2: Using some of the AWS services for creating Lambda triggers
Step 3: Executing the code when it is triggered

Inserting, updating, or deleting data from Dynamo DB tables, searching for log history in CloudTrail, adding entries to and modifying S3 objects, receiving Amazon SNS notifications, and a variety of other events can all trigger AWS Lambda functions. (Source)

What are the benefits of AWS Lambda?

  • Paying per use
    (only computing functions and network traffic are charged)
  • Fully managed infrastructure
    (no worries about the servers; focus is on code logic)
  • Automatic scaling
    (instances are created as they are requested)
  • Other AWS products are tightly integrated
    (possible to build functionally complete applications)

What are the limitations of AWS Lambda?

  • Possible latency between the event and start of function execution
    (there are methods to work around it)
  • A Lambda running function will time out after 15 minutes
    (Lambda should generally not be used in these situations)
  • Memory constraints
    (RAM and code package sizes are limited)
  • Not always cost-effective
    (when the load for the application increases, the cost increases proportionally) (Source)

To summarize, AWS Lambda functions allow developers to focus on the core product and business logic rather than managing OS access control, OS patching, right-sizing, provisioning, scaling, and other management challenges. (Source)

This is a general advantage of cloud services and solutions.  Libelle software allows you to take advantage of one of the biggest benefits of the cloud: Maximum flexibility for you and your deployed resources on a global scale. For example, our software solutions such as Libelle DataMasking (AWS / Microsoft Azure), Libelle SystemCopy (AWS / Microsoft Azure) and Libelle CloudShadow (IBM Cloud) are available to you in the various cloud marketplaces.

Recommended article
November 30, 2022 The 12 Factor App Part 3: (Disposability, Dev/prod parity, Logs, Admin processes)

All blog articles