Cloud Continuous Delivery of Flask Microservices: online chatting system
- AWS App runner
- AWS CloudFormation
- MongoDB Atlas
This online chatting system is designed to be straightforward and user-friendly. It is built using Flask, a popular Python-based microservice framework, and is deployed on the AWS App Runner platform. The system leverages the power of MongoDB Atlas, a highly scalable and reliable cloud-based database service, to store user profile and credentials. The chat microservice is deployed using AWS CloudFormation, a tool that enables users to create, manage, and update AWS infrastructure resources in a safe and predictable manner. This combination of powerful technologies ensures that the online chatting system is able to handle a large number of concurrent users and provide a fast and responsive user experience.
-
Flask Microservice: The main application logic is implemented using the Flask framework. It is responsible for handling incoming requests from users, processing chat messages, and interacting with the database.
-
MongoDB Atlas Database: The system uses MongoDB Atlas, a cloud-based NoSQL database service, to store chat messages and other data. This database is deployed on the AWS Cloud and can be easily scaled as the number of users grows.
-
AWS App Runner: The Flask microservice is deployed on the AWS App Runner platform, which provides a highly available and scalable infrastructure for running web applications. The App Runner automatically manages the deployment, scaling, and monitoring of the application.
-
AWS CloudFormation: The MongoDB Atlas database is deployed using AWS CloudFormation, which provides a safe and predictable way to manage cloud infrastructure. This allows for easy deployment and maintenance of the database and ensures that the infrastructure is in a known state.
-
Load Balancer: To ensure high availability and scalability, the system uses an AWS load balancer to distribute incoming traffic across multiple instances of the Flask microservice.
- Clone the repository and
cd
into the project directory - Install needed dependencies using
pip install -r app/requirements.txt
- Create a MongoDB Atlas database and add the connection string to the
MONGO_URI
environment variable in theapp/dao/db.py
file - Run the application using
gunicorn --worker-class eventlet -w 1 app.server:app
to start a production server, orpython app/server.py
to start a development server
Application is deployed on AWS
- Create a Microservice in Flask or Fast API
- Push source code to Github
- Configure Build System to Deploy changes
- Use IaC (Infrastructure as Code) to deploy code
- Use either AWS, Azure, GCP (recommended services include Google App Engine, AWS App Runner or Azure App Services) Containerization is optional, but recommended