Building a RESTful API
In this section, we will design, build, and deploy a RESTful API from scratch to explore some advanced topics involving Lambda and API Gateway.
API architecture
Before going into further detail about the architecture, we will look at an AIP that will help a local movie rental shop in managing their available movies. The following diagram shows how the API Gateway and Lambda fit into the API architecture:

AWS Lambda empowers microservice development. That being said, each endpoint triggers a different Lambda function. These functions are independent of one another and can be written in different languages. Hence, this leads to scaling at function level, easier unit testing, and loose coupling.
All requests from clients first go through the API Gateway. It then routes the incoming request to the right Lambda function accordingly.
Note
Note that a single Lambda function can Handle
multiple HTTP methods (GET
, POST
, PUT
, DELETE
, and so on). In order to leverage the power of...