Project Rough Draft
Project Rough Draft
o Private subnets
2. Microservices Stack
o API Gateway Microservice
o RabbitMQ (Messaging)
🔁 Communication Flow
1. Client sends request → API Gateway routes to correct service (e.g., Post).
2. Identity Service issues JWT token after login.
3. Post Service receives valid request → publishes event to RabbitMQ.
4. Search Service listens and updates the search index accordingly.
5. Client can query Search Service to retrieve relevant posts.
🔄 CI/CD Pipeline
Source Code Repositories: Hosted in CodeCommit or GitHub.
Pipeline: Built using AWS CodePipeline and includes:
o Source (CodeCommit/GitHub)
Benefits:
Eliminates configuration drift
Easy replication of environments (dev/staging/prod)
Version-controlled deployments
💰 Cost Optimization
Serverless (Fargate) and pay-as-you-go services reduce idle costs.
Redis and RabbitMQ use low-tier instances (like t3.micro) where applicable.
CloudFormation ensures repeatable, automated deployment without manual
errors.
Estimated Monthly Cost: ~$80–$130 depending on usage (detailed in R2).
📦 Tools & Technologies
Category Tool/Service
CodePipeline, CodeBuild,
CI/CD
CodeDeploy
Container
Amazon ECR
Repo
✅ R3 – Microservices-Based Architecture
The solution follows a domain-driven microservices design where each
service is self-contained, independently deployable, and owns its own data
and logic. Each microservice is containerized and deployed using AWS
Fargate for isolation and auto-scaling.
List of Microservices:
1. API Gateway Service – Handles all incoming requests and routes them to
backend services.
2. Identity Service – Responsible for authentication, user management, and
issuing JWT tokens.
3. Post Service – Manages post creation and event publishing to RabbitMQ.
4. Search Service – Consumes events from RabbitMQ and maintains a search
index.
5. RabbitMQ Service – Facilitates asynchronous communication between
services.
6. Redis Service – Provides fast, in-memory data storage for session
management or caching
🔄 R4 – Portability
All microservices are containerized using Docker and stored in Amazon
ECR, ensuring consistent execution across environments.
Stateless architecture and use of managed services (ECS, Redis,
RabbitMQ, etc.) ensure that services aren’t tied to any specific EC2 instance
or hardware.
The use of MongoDB Atlas ensures data is cloud-agnostic and not tied to AWS
infrastructure.
All services connect to MongoDB using connection strings secured via Secrets
Manager.
The database can be replicated or migrated to any cloud environment
supported by MongoDB (AWS, Azure, GCP).
🧰 R7 – Infrastructure as Code
The entire infrastructure is provisioned and managed using AWS
CloudFormation. It is split into:
🔹 Network Stack Template:
VPC
Subnets (private)
Security Groups
Application Load Balancer
🔹 Microservices Stack Template:
ECS Cluster & Services
Task Definitions for each service
IAM Roles
Target Groups and Listeners
RabbitMQ (via Amazon MQ)
Redis (via ElastiCache)
Mongodb
Benefits of IaC:
Reproducible environments
Version-controlled infrastructure
Quick recovery and scaling
Eliminates configuration drift
✅ Changes to the infrastructure can be tracked, reviewed, and rolled back just
like code.
✅ Summary Table
Requireme
Fulfilled by
nt