Navigating the AWS Serverless Landscape | Datadog
Navigating the AWS Serverless Landscape

serverless

Navigating modern compute with AWS serverless computing

Learn how to streamline modern application development by exploring the benefits, challenges, and best practices for building scalable, event-driven applications with AWS Lambda, AWS Step Functions, and AWS Fargate.

AWS serverless adoption

Serverless computing is a model that’s reshaping modern application development, allowing developers to deploy modern applications without managing infrastructure. Amazon Web Services (AWS) is an increasingly popular serverless solution. AWS serverless adoption experienced a 3 percent growth rate from 2022 to 2023, with more than 70 percent of Datadog’s AWS customers using one or more serverless solutions.

This popularity underlines the value of deploying applications without worrying about how to seamlessly scale infrastructure management from a handful of users to millions overnight.

Figure 1. Serverless computing usage continues to rise across major clouds, including AWS, Google Cloud Platform, and Microsoft Azure
Figure 1. Serverless computing usage continues to rise across major clouds, including AWS, Google Cloud Platform, and Microsoft Azure

As seen in Figure 1, AWS serverless computing shows a wider percentage of adoption as compared to Google Cloud and Microsoft Azure, allowing developers to focus on code while AWS handles scaling, resource allocation, and execution. AWS Lambda, AWS Step Functions, and AWS Fargate enable cost-effective, high-availability applications without the need for server provisioning.

This guide, the first of a three-part series, explores the AWS serverless landscape, detailing key workload types and services, use cases, and monitoring best practices that can help organizations maximize the benefits of serverless computing.

What is serverless computing?

Serverless computing is a cloud-computing model that enables developers to build and deploy applications without managing infrastructure. Serverless applications are built to run entirely or partially in the public cloud using serverless services. AWS provides a wide range of serverless solutions across various domains, including compute, storage, application integration, orchestration, and databases. These cloud-based services allow developer and DevOps teams to focus on writing code, monitoring, and troubleshooting problems, while the cloud provider handles tasks like resource provisioning, service scaling, and server maintenance.

Serverless computing usage continues to rise across major clouds

With its rising popularity, serverless computing continues to supplant traditional application infrastructures as organizations use it to streamline, accelerate, and orchestrate DevOps workflows. Major cloud providers such as AWS, Google Cloud Platform, and Azure, along with the Vercel and Cloudflare platforms, offer a growing selection of serverless compute services specifically designed for modern computing.

Platform-as-a-service (PaaS) solutions initially allowed developers to build, test, and deploy applications without managing infrastructure. With the rise of PaaS, major providers launched cloud-based service offerings that integrated with infrastructure-as-a-service (IaaS) and software-as-a-service (SaaS) solutions into seamless workflows. With the incorporation of function-as-a-service (FaaS) solutions, developers acquire the ability to run individual functions in response to events without managing the underlying servers. Serverless computing has since expanded beyond the traditional FaaS functionality to include containers with serverless orchestration workloads like Fargate. These containers deliver the flexibility and control to allocate resources precisely and scale applications automatically and effectively.

Why is serverless computing important?

Serverless computing has gained widespread adoption because it enables faster development, improved scalability, and better cost savings compared to traditional server infrastructures. The ability to offload infrastructure management frees up DevOps, engineering, and security teams to focus on business and operational goals. Some of the key benefits of serverless computing include:

  1. Cost efficiency. Businesses deploying serverless computing services pay only for the compute time used, eliminating power and space costs that might otherwise be wasted on idle infrastructure.
  2. Automatic scaling. Serverless applications scale dynamically, ensuring optimal performance for varying loads without manual intervention.
  3. Innovation: By eliminating the need to manage infrastructure, developers can focus on strategic planning, building new features, and driving innovation.
  4. Faster development cycles. Simplified deployment processes and reduced infrastructure management help accelerate development cycles.
  5. High availability. Services such as AWS Lambda, AWS Step Functions, AWS Fargate for Amazon Elastic Container Service (Amazon ECS), and AWS Fargate for Amazon Elastic Kubernetes Services (Amazon EKS) come with built-in fault tolerance, high availability, and service-level agreements (SLAs).

How AWS serverless computing works

In an AWS serverless architecture, managed services are used to manage workflows without requiring traditional server infrastructure. These serverless workflows are easier to manage and troubleshoot because they can be restarted from the point of failure. AWS services often work together in a workflow. For example, an AWS Step Functions workflow might use AWS Lambda functions to process data and AWS Fargate tasks to run complex, long-running applications.

AWS Lambda, AWS Step Functions, and AWS Fargate are among the available AWS serverless offerings. For more information, refer to Serverless on AWS.

  • AWS Lambda is used for running individual code functions in response to events. AWS Lambda is ideal for event-driven applications such as Amazon Simple Storage Service (Amazon S3) buckets, Amazon DynamoDB, Amazon SQS messaging, independent microservices, and scheduled backups.
  • AWS Step Functions is used for orchestrating workflows that might include AWS Lambda functions and AWS Fargate tasks, in addition to other AWS services, making it particularly adept at handling complex workflows. The orchestration is typically implemented as a series of event-driven steps, which can be visualized using state machines. AWS Step Functions includes robust error handling capabilities, such as built-in fault tolerance and retry mechanisms, which make it an excellent choice for ensuring application high availability.
  • AWS Fargate is used for running containerized applications, microservices, and batch processing workloads. It integrates seamlessly with Amazon ECS and Amazon EKS, automatically provisioning CPU and memory resources for individual tasks or pods running in isolated environments. Because containerized applications require precise resource allocation, AWS Fargate provides fine-grained control over container images and CPU and memory requirements.

Key use cases for AWS serverless computing

AWS serverless computing solutions offer a wide range of services optimized for event-driven computing, workflow orchestration, and containerized workloads, ensuring flexibility for various use cases.

  • Getting started with serverless. AWS Lambda supports nearly any programming language, with the two most popular being Node.js and Python. These two languages are supported by robust tools and active developer communities, enabling developers to run serverless functions with either supported or custom runtimes. For larger organizations, Terraform is the preferred tool for deploying AWS Lambda, especially within a diverse cloud infrastructure.
  • Event-driven tasks are fundamental to serverless computing and offer the ability to quickly respond to changes. AWS Lambda is ideal for automatically handling real-time events, such as changes and updates, messages in Amazon S3 buckets or Amazon DynamoDB, and messages in an Amazon SQS queue. AWS Lambda is also an ideal service for running independent microservices and performing scheduled tasks like periodic backups.
  • Business-critical applications need robust error-handling capabilities. AWS Step Functions is used to orchestrate and monitor complex workflows. It enables teams to include fault tolerance and retry mechanisms, making it ideal for business-critical applications requiring high availability.
  • Containerized services are designed for deploying microservices, allowing each service to run in its own isolated environment. This complex architecture uses multiple service dependencies that must be scaled individually and that are highly dependent on resource allocations. AWS Fargate for Amazon ECS and AWS Fargate for Amazon EKS are managed container orchestration services that can help simplify the deployment and management of containerized services.

Challenges in implementing AWS serverless computing architectures

When adopting a serverless architecture, developer and DevOps teams might need to navigate complexities to ensure a smooth implementation. These challenges include:

  1. Cold starts. Functions that have been inactive might experience a delay when first invoked.
  2. End-to-end observability. Traditional monitoring tools might not fully capture metrics for transient and distributed workloads.
  3. Vendor lock-in. A reliance on vendor-specific services can hamper workstream migration to other cloud providers.
  4. Cost management. Serverless functions like AWS Lambda and AWS Fargate tasks are charged based on data traffic, such as execution duration and number of invocations, meaning high-traffic APIs can generate substantial costs.

Adopting a serverless architecture, particularly at scale, requires a strategic approach that extends beyond just deploying code. A best-practices strategy includes comprehensive visibility into the managed services that drive serverless applications and technologies for optimizing application performance.

Features to look for in a monitoring solution

An advanced monitoring solution is essential for ensuring optimal performance and cost efficiency in an AWS serverless architecture. Serverless workloads are distributed and transient, requiring specialized monitoring and observability tools. Look for a monitoring solution that delivers visibility into serverless applications and that ensures they are secure, reliable, and highly performant:

  1. Remote bulk instrumentation delivers automated and secure AWS Lambda instrumentation across multiple accounts and regions.
  2. Enhanced metric granularity and retention enables you to generate and visualize real-time, enhanced, and custom metrics such as cold starts, memory usage, timeouts, and estimated costs.
  3. Detection and alerts for deprecated runtimes can send warnings to the AWS Lambda serverless page about any functions that are using deprecated runtimes.
  4. Streamlined error remediation provides the ability to automatically re-drive or re-run error remediation in AWS Step Functions.
  5. Cold-start monitoring identifies execution delays, enabling optimization of function execution times during cold starts.
  6. End-to-end distributed tracing visualizes a request flow across AWS services, an essential tool for a serverless debugging journey.
  7. Customizable dashboards offer real-time performance metrics and customization for key indicators.
  8. Automatic deployment tracking helps identify if a new version of code or a configuration change is causing a spike in errors, degraded performance, or a drift from a cloud environment’s expected state.
  9. Resource consumption analysis offers a detailed view into resource usage and service performance.

Learn more

By using an AWS serverless architecture with a comprehensive observability solution, organizations can detect and resolve serverless application performance issues quickly, optimize DevOps costs, and ensure reliable and highly performant applications. Learn more about monitoring serverless architectures:

Identify and optimize the application performance and resource usag of your AWS serverless architecture with Datadog serverless monitoring solutions:

Related Content

Learn about Datadog at your own pace with these on-demand resources.

gated-asset/210524_Serverless_Preview

guide

Serverless Monitoring Product Brief
serverless/serverless-hero

product

Datadog End-to-end Serverless Monitoring
/blog/key-metrics-for-monitoring-aws-lambda/lambda_part1

BLOG

Key metrics for monitoring AWS Lambda
Get free unlimited monitoring for 14 days