Serverless Architecture Patterns in AWS
Serverless architecture is a way to build and run applications and services without having to manage infrastructure. The approach helps the teams to focus on the actual business value add and forget about the Infrastructure management. There are many other advantages with Serverless based architecture and you could find blogs covering the same.
The focus of this blog is to cover some of the Serverless Architecture patterns that I have used in real life projects. Let’s take a look at them —
Pattern 1 — This is the simplest architecture pattern that you would come across the moment you search for Serverless based architecture.
A backend service with AWS API Gateway acting as the Proxy layer for the Lambda based business functions. Lambda functions are invoked by API Gateway in a synchronous fashion. Data is saved or retrieved from AWS DynamoDB, a Managed NoSQL Serverless service from AWS.
API Gateway comes with lot of additional features like Caching, Rate Limit, etc. which can be leveraged as per the business need.
Single Lambda function for all the business functionalities or one Lambda per business functionality is a typical question that I am generally asked? Well, to keep it simple and secure — Use Single Responsibility Principle and have one Lambda function per business functionality. Club all related Lambda functions to have high cohesive ness and form a Microservice for the specific domain. And follow Least Privilege principle — Each…