3 tier architecture with CICD
Published: 2023-10-16 09:04:56

## ABC Platform Documentation

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cb6fdlv1s6gdhuvn6ij6.png)
## Overview

The ABC platform is structured into three distinct tiers: Frontend, Backend, and Database. This documentation provides an overview of the architecture, technologies used, and deployment strategies within each tier.

## Frontend Tier

### Hosting
The Frontend of the ABC platform is hosted in AWS S3, and its content is distributed via AWS CloudFront, a content delivery network. AWS Certificate Manager is used to request SSL/TLS certificates for the CloudFront domain.

### DNS Management
The CloudFront DNS is managed through AWS Route 53, where all Domain Name System (DNS) configurations are handled.

## Backend Tier

### Hosting
Backend services are hosted in AWS ECS Fargate, a serverless service designed for orchestrating Docker containers. To facilitate this, we create an ECS cluster, where services are deployed. Each service is defined by a task definition, specifying details like the Docker image to run. Deploying task definitions results in the creation of tasks, which are the containers responsible for running each service.

### Docker Images
Docker images are built and stored in AWS Elastic Container Registry (ECR), from which they are pulled into AWS ECS services for execution.

## Database Tier

### Main Database
The primary database for the ABC platform is MySQL. The data will be migrated from its original source into AWS RDS Aurora for MySQL. This transition is made to optimize cost-efficiency and enhance overall database performance, as Aurora for MySQL is considered more efficient than RDS for MySQL.

### Chat App Database
For the chat app component of the platform, the current MongoDB database will be migrated to use Amazon DynamoDB, a NoSQL database service compatible with MongoDB. This migration aims to improve the efficiency and scalability of the chat app's data management.

## Monitoring

### Log Management
All logs generated by the ABC platform are sent to AWS CloudWatch. This centralizes log management and facilitates the creation of metrics and alarms to promptly notify administrators of potential issues within the platform.

### Notifications
AWS Simple Notification Service (SNS) is utilized for all notification purposes, ensuring that administrators are promptly informed of any critical events.

## CI/CD (Continuous Integration/Continuous Deployment)

### Source Code Management
The source code of the ABC platform is stored in Bitbucket, a Git-based source code management platform.

### CI/CD Pipelines
Bitbucket is configured to run CI/CD pipelines responsible for building and deploying artifacts to AWS S3 for the frontend and Docker images to AWS ECR for storage.

### Backend Deployment
To deploy the backend services, AWS CodeDeploy is used in conjunction with Bitbucket. This combination facilitates seamless updates to the AWS ECS tasks, ensuring a smooth deployment process.

### SonarQube Integration
The ABC platform utilizes SonarQube, a powerful code analysis tool, within the CI/CD pipeline. SonarQube is used to perform continuous code quality checks and identify issues, vulnerabilities, and code smells in the source code. These checks help maintain code quality and security throughout the development and deployment process.

## AWS Accounts

### Multi-Account Strategy
ABC employs a multi-account strategy to host various environments, including development, staging, and production. AWS Organizations is used for centralized management of these accounts, while AWS IAM Identity Center is leveraged to manage permissions for users across the accounts.

This documentation provides an insight into the architecture, technologies, and strategies used within the ABC platform. For more detailed instructions and configurations, please refer to specific documents related to each tier or service.