Project information
- Category: Web Application
- Project date: Feb 2021 - Apr 2021
- Project URL: https://ascenda-g1t2.live (delisted)
Hotel Booking Platform (Hotel Lobang)
This project was part of a collaboration with Ascenda Loyalty. We were to build a high-performing application with the use of Amazon Web Services (AWS). The aim for this project was to ensure that this application is highly scalable and available, pulling data from different suppliers and aggregating the results for customers.
Tools & Technologies used:
- Python Flask [backend services]
- React JS [frontend services]
- Redis [caching]
- MySQL [database]
My friend and I have written articles on some aspects of the web application that we have developed. You can view the articles here:
- Aggregating results asynchronously with Redis cache, Python
- Achieving low latency with Amazon CloudFront
Other aspects of how we leveraged AWS services:
- AWS CodePipeline
- AWS S3 + CloudFront
- AWS ECS
For continuous integration and continuous development (CI/CD), our team used AWS CodePipeline together with our GitHub repositories. Once we commit our codes to the appropriate branches on GitHub, AWS CodeBuild in the AWS Pipeline will be triggered via a webhook. AWS CodeBuild will then pull the latest source codes from GitHub and run the various phases according to the buildspec.yml file that we have in our code repository.
For the backend repository, the commands specified in the buildspec.yml file will set up the application by installing the necessary packages and then do a lint check on the code. The docker images will be built and pushed to the AWS Elastic Container Registry (ECR), defining it as the latest version.
After a successful build on AWS CodeBuild, AWS CodeDeploy will continue and deploy the updated code by spinning up a new task in AWS Fargate. As we use blue/green deployment strategy, the existing traffic for the load balancer will be routed to the new tasks created. We set an hour for any immediate rollbacks required. After an hour, the old tasks will be removed.
Similarly, for the frontend, AWS CodeBuild ensures that the frontend repository can be build and it then updates the AWS S3 bucket (hosting our frontend static webpage) with the latest changes.
Using S3 to host the frontend static webpage and CloudFront to deliver the content with S3 as origin. As our frontend is built on React, we can customise a static build to host it on S3, which claims to have 99.999999999% durability. With CloudFront, we can then serve the content. Securing our application with HTTPS and SSL is easier with CloudFront (with AWS Certificate Manager), protecting the website against threats like DDOS. CloudFront being a CDN service also means that it provides quicker performance to multiple users around the globe.
Using AWS ECS Fargate (serverless) compute engine to scale our entire backend application in containers. Pairing this with AWS CodePipeline, it allows for easier management and deployment of our application from the docker images stored in AWS Elastic Container Registry (ECR). With EC2 instances, scaling will be much slower as it takes a while for the instance to set up and run the application. Spinning up a container with Fargate is easier and faster. Unused EC2 capacity would also have been billed to us thus a serverless architecture like Fargate would result in lesser overhead, decreasing operational cost.
The following is our architecture diagram, making use of the various AWS services to meet the requirements.
