Nsupyq / idempotent-serverless-functions

Examples of idempotent serverless functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

idempotent-serverless-functions

Examples of idempotent serverless functions

This repository demonstrates how to ensure the idempotence of serverless functions, which run on AWS Lambda using the traditional Serverless Framework. Our examples are based on the examples in the repository Serverless Examples. We add idempotence to the original functions.

What is idempotence

Idempotence means multiple invocations of a function have the same side-effect as one invocation.

Why we need idempotence

AWS Lambda uses retry to perform fault tolerance. When your function fails because of out of memory or some other reasons, it will be directly retried until it finishes successfully. For serverless functions with side-effect, retry may cause data inconsistency. For example, retrying a function purchasing a product may cause multiple deduction of money. Therefore, AWS Lambda requires programmers to write idempotent function.

About

Examples of idempotent serverless functions


Languages

Language:Python 82.2%Language:JavaScript 17.8%