Technology RadarTechnology Radar

AWS Serverless

Trial

Serverless computing is a cloud native development model that makes use of third party services to execute code on ephemeral executors.

AWS has a wide choice of tools for implementing serverless architectures, like functions-as-a-service (Lambda), queues (SNS, SQS...), event routers (EventBridge) and so on. Serverless architectures scale linearly with volumes and foster modularization of code and clear separation of concerns.

A few tips for adoption:

  • Lambdas are billed depending on execution time. It's usually better to use a fast language with a lighweight runtime, like Rust
  • When an AWS Lambda function is invoked for the first time or after a period of inactivity, AWS provisions a new function instance. This impacts latency by causing an initial delay - typically 100ms to 1 second - before execution
  • A Lambda execution timeout is 15 minutes, not negotiable. Consider other solutions (e.g. ECS Batch on Fargate) for long running jobs
  • You can make use of features from AWS tools that help you implement best practices around event-driven systems, like DynamoDB Streams: make sure you know the tool you're using
  • AWS bills can ramp up unexpectedly (e.g. when spamming logs under CloudTrail's watch)
  • Costs of associated services (e.g. CloudWatch, RDBMS, CloudTrail...) can be really high and ramp up our AWS Bill; you should evaluate them when comparing alternatives