Skip to main content
AWS is the largest cloud provider with the most flexible deployment options for Arivu. This guide covers all available architectures.

Architecture Comparison

Step-by-Step Implementation

1

1. Create AWS Account & IAM Setup

2

2. Create VPC & Network Infrastructure

Use Terraform or CloudFormation to create:
  • VPC with public/private subnets
  • NAT Gateway for outbound traffic
  • Security Groups for ECS, RDS
3

3. Set Up RDS Database

Create PostgreSQL database:
4

4. Create ElastiCache Redis

For distributed memory backend:
5

5. Create ECR Repositories

6

6. Build and Push Docker Images

Dockerfile for Backend:
Build and push:
7

7. Create ECS Task Definition

8

8. Create ECS Service

9

9. Set Up Load Balancer

10

10. Configure Auto Scaling

Cost Breakdown (Monthly)

Security Best Practices

Secrets Management

Store all secrets in AWS Secrets Manager:
  • Security Group: Only allow port 8000 from ALB
  • VPC: Place RDS in private subnet
  • NAT Gateway: For outbound internet access
  • VPC Flow Logs: Monitor traffic
  • IAM roles with least privilege
  • No root account usage
  • Enable MFA on console login
  • Use AWS SSO for team access
  • CloudWatch for logs and metrics
  • X-Ray for request tracing
  • CloudTrail for audit logs
  • GuardDuty for threat detection

Troubleshooting

  • Increase task memory allocation
  • Check for memory leaks in LLM calls
  • Use Redis instead of SQLite for memory backend
  • Verify RDS security group allows traffic from ECS security group
  • Check database credentials in Secrets Manager
  • Verify connection string format

Scaling Considerations

Horizontal Scaling

  • Load Balancer distributes traffic
  • Auto Scaling Group expands/shrinks
  • State stored in Redis (not local)
  • Supports unlimited horizontal scale

Vertical Scaling

  • Increase CPU/memory per task
  • Improve database instance size
  • Use RDS Aurora for read replicas
  • Implement query caching

Next Steps

  1. Customize the setup: Modify VPC CIDR, instance types, and region
  2. Set up CI/CD: GitHub Actions to auto-build and deploy
  3. Configure monitoring: CloudWatch dashboards and alarms
  4. Implement backup strategy: RDS automated backups, S3 versioning
  5. Plan scaling: Set auto-scaling policies based on metrics