# LotusCloud Multi-Region Architecture

## Region Layout

```
LotusCloud Global
  │
  ├── Region VN-South (Ho Chi Minh)
  │     ├── AZ vn-hcm-1
  │     ├── AZ vn-hcm-2
  │     └── AZ vn-hcm-3
  │
  ├── Region VN-North (Hanoi)
  │     ├── AZ vn-hn-1
  │     └── AZ vn-hn-2
  │
  └── Region VN-Central (Da Nang)
        └── AZ vn-dn-1
```

## Availability Zone Architecture

Each AZ is an independent datacenter containing:

- Compute cluster (KVM hypervisors)
- Storage cluster (Ceph OSD nodes)
- Network fabric (spine-leaf)
- Control plane replica

## Traffic Routing

```
User → Global DNS (Anycast)
     → Nearest Edge POP
     → Regional API Gateway
     → AZ-local services
```

### Routing Strategies

- **Geo routing**: Route to nearest region by IP geolocation
- **Latency routing**: Route to lowest-latency region
- **Weighted routing**: Distribute traffic (e.g. HCM 60%, HN 40%)
- **Failover routing**: Primary region fails → backup region takes over

## Cross-Region Replication

| Service | Replication Method |
|---------|-------------------|
| Object Storage | Async Ceph RGW multi-site |
| Block Storage | Snapshot + cross-region copy |
| Database (DBaaS) | Read replicas in secondary region |
| Container Registry | Image sync between regions |
| DNS | Global anycast, all regions serve |

## Global Load Balancer

LotusCloud `global-lb-service` (port 8118) manages:

- Origins across multiple regions
- Health checks per origin
- Weighted traffic distribution
- Automatic failover on region failure

## Regional Failover Flow

```
Region VN-South failure detected
  → Monitor alerts global-lb
  → DNS weight shifts to VN-North
  → Traffic reroutes in < 60 seconds
  → Self-healing triggers VM migration
```

## Region Isolation

Each region operates independently:

- Own control plane cluster
- Own storage cluster
- Own network fabric
- Shared global: DNS, IAM, billing
