Building a Serverless Recipe-Sharing Application
In the previous chapter, you developed a recipe sharing application with a frontend hosted on Amazon S3 and CloudFront, and a backend using Amazon EC2 instances and DynamoDB. For the end user, only the functionalities and the overall user experience are visible, but it is up to the provider to define how to architect the application and which technologies to use.
Traditional application deployment involves provisioning and managing servers, configuring environments, scaling resources, applying security patches, and monitoring system health. This approach requires significant operational overhead and often leads to inefficient resource utilization as resources are provisioned for peak demand.
In contrast, serverless computing abstracts away the underlying infrastructure, allowing developers to focus solely on writing code. With serverless, the provisioning, scaling, and server management are handled by the cloud provider, enabling a more agile, event-driven approach with a pay-as-you-go model.
Event-driven architectures consist of separate services that interact with each other through events. When a user requests to create a new recipe, for example, that request becomes an event. This event then triggers the necessary code to handle the business logic related to creating the recipe. By using this approach, the system doesn’t need to have all the resources prepared and allocated in advance. Instead, it responds to events as they occur, making the architecture more efficient and adaptable.
In this chapter, you will experiment with the adoption of serverless technologies by rearchitecting your recipe-sharing application with solely serverless technologies.
In summary, this chapter covers the following topics in order:
- What you are going to build – the latest version of the recipe sharing application solely supported by serverless technologies
- How you are going to build it – Amazon API Gateway and Lambda for the backend and Amazon Cognito for authentication
- Building it – through CloudFormation and using the AWS console
- How to improve the solution – support media content for your recipes and extend authentication to the end users for a more customized experience
By the end of this chapter, you will gain hands-on experience in rearchitecting a dynamic web application using AWS serverless technologies such as Lambda, API Gateway, Cognito, S3, and DynamoDB. You will also understand the benefits of serverless computing, such as scalability and cost-effectiveness, in modern application development.