The objective of this article is to create two lambda functions. Out of which, one function will write datas to the DynamoDB table and the other function will read datas from the DynamoDB table. Moreover, both the functions will be invoked by API Gateway calls.

Basically, in this project, we are following the Single Responsibility Principle(SRP), as both the lambdas have unique and only one responsibility.

It is important to note that this project will be created in our local machine and then it will de deployed into AWS Cloud.

Before jumping into procedures to build the application, let’s understand the basics of the AWS services that we are going to use.

Amazon API Gateway

AWS API gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor and secure APIs. API acts as a front door for the application to access data, business logic or functionality from the backend services. It handles all the task involved in accepting and processing up of hundreds or thousands of concurrent API calls, including traffic management, authorization, access control, monitoring and API management.

For this project, there will also be one front door to our application with two resources. One resource will invoke one lambda and the other resource will invoke another lambda.

AWS Lambda

AWS lambda lets the user to run code without provisioning or managing servers and the user needs to pay for how much they use. The user can also scale it up and down according to their needs.

Amazon DynamoDB

Amazon DynamoDB is a fully managed proprietary NoSQL database service that supports key-value and document data structures. It allows us to create database tables that can store and retrieve any amount of data. It also relieves the customers from the burden of operating and scaling a distributed database.

#sam-cli #api-gateway #aws-lambda #nodejs #dynamodb

Serverless Application with API Gateway, AWS Lambda and DynamoDB using SAM.
3.00 GEEK