---
# System prepended metadata

title: Cloud architecture proposal

---

# Cloud architecture proposal

## Assumptions: 
1. This application doesn't need to be centralized or communicate between regions (each region can be hosted independently or the sync will be handled by dev team)
2. It's assumed to be working in docker containers 


## Proposal

### Main ideas
1. Deploy full instances in several regions (depending on the load in different regions, but for simplicity `us-east-1`, `ap-southeast-1` and `eu-central-1`). Initial routing will be done on `Route 53`, terminating on `ELB`
2. Within a region, DB and cache should be deployed in several AZs, so data is saved durably in case of a failure. In AWS it will be: `ElastiCache` for redis and `Amazon RDS`
3. Applications (both WEBUI and WEBAPI) will be running in `Amazon ECS` multi AZ, so we save on operations costs and not compromise availability. This will also allow scaling up and down flexibly. Also `API Gateway` will be required most probably.
4. All of the services will be bounded together into one `VPC` within one region and peered if needed. Since no DBs/caches will be exposed, basic "DMZ" will be done
5. For simplicity of operations, we can build up monitoring around `CloudWatch` with custom metrics


### Costs
1. This solution allows to have minimal operational costs in terms of staff 
2. Flexibility of ECS will allow to save costs in non-working time



### Operations
1. Since all used services are managed, except for major upgrades (usually they are done manually by clicking a button) will be automatically handled. 
2. New version rollout can be done in a blue-green manner with containers and rollback if needed. 


## Maintainability
1. This pattern will be easy to implement in IaC, which will reduce the amount of redundant code and unify the process of management


