Overview
Iqra AI’s multi-region architecture allows you to deploy geographically distributed infrastructure to minimize latency and improve reliability. The system routes sessions to the nearest compute node based on geographic proximity, enabling you to combat the physical limitations of network speed. This is particularly critical for real-time voice applications where every millisecond counts in the user experience.Architecture
Region components
Each region in Iqra AI consists of three core components:- Backend servers - Handle agent logic, conversation processing, and business rules
- Proxy servers - Manage WebRTC/SIP connections and media streaming
- S3 storage - Store recordings, logs, and media files
{CountryCode}-{RegionName} (e.g., US-EAST, EU-CENTRAL).
The region management system is located in
IqraInfrastructure/Managers/Region/RegionManager.cs:66.Regional isolation
Each region operates independently with its own:- Compute resources (Backend and Proxy nodes)
- Storage infrastructure (S3-compatible object storage)
- Maintenance and availability status
- Configuration and API keys
Creating a region
Define region parameters
Choose a country code and region name that clearly identifies the geographic location.
Create the region
New regions are created in a safe, disabled state by default:This creates region
US-WEST with:- Disabled status (prevents accidental traffic routing)
- Maintenance mode enabled
- No active servers
Server management
Adding servers
Each region can contain multiple Backend and Proxy servers for horizontal scaling:Server lifecycle
Servers support granular lifecycle management:Enable/disable servers
Enable/disable servers
Control traffic routing to individual servers:
Maintenance mode
Maintenance mode
Put servers in maintenance mode without fully disabling them:
Safe deletion
Safe deletion
Servers can only be deleted when they meet strict safety criteria:Deletion will fail if:
- Server is not in disabled state
- Server is still reporting online status
- Server has active sessions
Region status management
Maintenance mode
Use maintenance mode for planned updates without fully disabling the region:Disabling regions
Temporarily or permanently disable regions:Best practices
Geographic distribution
Measure user distribution
Analyze where your users are located geographically. Deploy regions close to your largest user populations.
Start with critical regions
Begin with 1-2 regions in your primary markets before expanding globally.
Capacity planning
Plan server capacity based on expected concurrent sessions:- Backend servers: 50-100 concurrent calls per server (depending on hardware)
- Proxy servers: 100-200 concurrent WebRTC connections per server
- Storage: Estimate 1-5 MB per minute of recorded conversation
Failover strategy
- Deploy redundant servers in each region (minimum 2 Backend, 2 Proxy)
- Use health checks to detect failing nodes
- Configure automatic traffic rerouting when servers enter maintenance mode
- Maintain a secondary region for critical deployments
Security
- Rotate API keys quarterly
- Use different S3 credentials for each region
- Implement network isolation between regions
- Restrict database access to internal networks only
Monitoring regions
Monitor regional health using the metrics system:Deleting regions
Region deletion requires strict safety checks:The deletion will fail with error
DeleteRegion:NODES_ONLINE if any servers are still reporting status. This prevents accidental deletion of active infrastructure.Next steps
Monitoring
Set up observability for your multi-region deployment
Scaling
Learn horizontal scaling strategies for high traffic