Programming

All you need to know about caching for serverless applications

Last week, someone asked me at the AWS User Group in The Hague “Is caching still relevant for serverless applications?”  The assumption here is that Lambda auto-scales by traffic, so do we still need to worry about caching? And if so, where and how do we implement caching? So let’s break it down. Caching is …

All you need to know about caching for serverless applications Read More »

AWS Lambda: how to share code between functions in a monorepo

A while back, a client asked me “how can I share business logic between services in a Node.js monorepo?”. The TL;DR of it is: Encapsulate the shared business logic into modules, and put them in a separate folder. In the Lambda handler functions, reference the shared modules using relative paths. Use webpack to resolve and …

AWS Lambda: how to share code between functions in a monorepo Read More »

Step Functions as an ad-hoc scheduling mechanism

We previously discussed how you can implement an ad-hoc scheduling system using DynamoDB TTL as well as CloudWatch Events. And now, let’s see how you can implement the same system using AWS Step Functions and the pros and cons of this approach. As before, we will assess this approach using the following criteria: Precision: how …

Step Functions as an ad-hoc scheduling mechanism Read More »

Using CloudWatch and Lambda to implement ad-hoc scheduling

A while back I wrote about using DynamoDB TTL to implement ad-hoc scheduling. It generated some healthy debate and a few of you have mentioned alternatives including using Step Functions. So let’s take a look at some of these alternatives, starting with the simplest – using a cron job. We will assess this approach using the …

Using CloudWatch and Lambda to implement ad-hoc scheduling Read More »

Making Terraform and Serverless framework work together

Update 07/04/2023: Since I originally wrote this post, my preference has shifted to using SSM Parameter Store to share information between Terraform and the Serverless framework. This is preferable because: The Serverless Framework has built-in support for reading data from SSM, with the ${ssm:/path/to/param} syntax. CloudFormation is used to provision resources, using it as a …

Making Terraform and Serverless framework work together Read More »

Understanding the scaling behaviour of DynamoDB OnDemand tables

Update 15/03/2019: Thanks to Zac Charles who pointed me to this new page in the DynamoDB docs. It explains how the OnDemand capacity mode works. Turns out you DON’T need to pre-warm a table. You just need to create the table with the desired peak throughput (Provisioned), and then change it to OnDemand. After you change the table to OnDemand …

Understanding the scaling behaviour of DynamoDB OnDemand tables Read More »

DynamoDB TTL as an ad-hoc scheduling mechanism

CloudWatch Events let you easily create cron jobs with Lambda. However, it’s not designed for running lots of ad-hoc tasks, each to be executed once, at a specific time. The default limit on CloudWatch Events is a lowly 100 rules per region per account. It’s a soft limit, so it’s possible to request a limit …

DynamoDB TTL as an ad-hoc scheduling mechanism Read More »

What is the best event source for doing pub-sub with AWS Lambda?

AWS offers a wealth of options for implementing messaging patterns such as pub-sub with Lambda, let’s compare and contrast some of these options. The pub-sub pattern Publish-Subscribe (often shortened to pub-sub) is a messaging pattern where publishers and subscribers are decoupled through an intermediary broker (ZeroMQ, RabbitMQ, SNS, etc.). SNS + Lambda In the AWS ecosystem, the obvious …

What is the best event source for doing pub-sub with AWS Lambda? Read More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close