Chapter 2: Building with Fauna + AWS
Business logic with AWS Lambda

Business logic with AWS Lambda

AWS Lambda functions are the backbone of your application in an event-driven system. All the business logic happens inside lambda functions. Depending on the complexity, you may have hundreds of lambda functions in an application.

For this sample application, however, we will keep things simple. We will have three lambda functions in total. They are as follows.

  • bookFlight (Books flight and updates database record)
  • bookHotel (Books hotel and updates database record)
  • calcelHotel (Cancels hotel booking if flight booking fails and updates database record.)

Following is a simplified flow of the application.


In the next section, we will build these lambda functions. We will orchestrate this flow in the later chapters with an AWS step function.

Last updated on August 5, 2022