Skip to main content
Geo-distributed deployment runs one Lasso node per region, with each node measuring latency to upstream providers from its geographic location. Applications connect to their nearest node for region-optimized routing.

Architecture

Deployment Model

Deploy one Lasso node per region and route application traffic to the nearest node:

Optional: Cluster Aggregation

Connect nodes via clustering for unified observability:

Key Principles

Independent Node Operation

  • Each node runs a complete, isolated supervision tree
  • Routing decisions based on local latency measurements only
  • No cluster consensus or coordination in request hot path
  • A single node works standalone without clustering

Regional Latency Awareness

  • Passive benchmarking reveals which providers are fastest from each region
  • Provider performance varies significantly by geography
  • Example: Alchemy may be fastest in US-East but slower in EU-West
  • Each node discovers the optimal provider for its region

Observability-First Clustering

  • Clustering aggregates metrics for dashboards only
  • View cluster as unified whole or drill into regions
  • Identify providers struggling in specific regions
  • No routing impact: clustering is purely for observability

Configuration

Region-Specific Node IDs

Set LASSO_NODE_ID to match the deployment region:
Importance:
  • Metrics are partitioned by {provider_id, node_id}
  • Dashboard groups performance by region
  • Circuit breaker states are per-node
  • Enables regional comparison in observability

Enable Clustering (Optional)

To aggregate metrics across regions, enable clustering on all nodes:
See Clustering for DNS setup details.

Traffic Routing

Route application traffic to the nearest Lasso node using:

GeoDNS

Use geographic DNS routing to direct clients to the nearest node:
Providers:
  • AWS Route 53 (geolocation routing)
  • Cloudflare (geo-routing)
  • Google Cloud DNS (geolocation routing)
  • Azure Traffic Manager

Anycast

Announce the same IP from multiple regions, with BGP routing traffic to the nearest location:
Characteristics:
  • Automatic nearest-region routing via BGP
  • No DNS-based routing required
  • Requires anycast-capable infrastructure (Cloudflare, cloud providers)

Load Balancer Geographic Routing

Use cloud load balancers with geographic routing:
  • AWS Global Accelerator: Anycast + health checks
  • GCP Global Load Balancer: Cross-region load balancing
  • Azure Front Door: Global HTTP load balancer
  • Cloudflare Load Balancer: Geo-steering

Deployment Examples

Kubernetes Multi-Region

1

Deploy to each region

Repeat for eu-west-1 and ap-southeast-1 clusters with region-specific LASSO_NODE_ID and PHX_HOST.
2

Configure cross-region service discovery

For cross-region clustering, use a global DNS service that resolves to all regional cluster IPs:
3

Set up GeoDNS for traffic routing

Docker Swarm Multi-Region

VM/Bare Metal Multi-Region

1

Deploy to each region

Repeat for EU-West and AP-Southeast with region-specific values.
2

Configure service discovery

Use Consul, etcd, or cloud DNS to maintain lasso.internal.example.com resolving to all node IPs.
3

Set up load balancer

Configure a load balancer (HAProxy, nginx, cloud LB) with geographic routing to regional nodes.

Regional Performance Comparison

The dashboard provides regional drill-down when clustering is enabled:

Aggregate View

View performance across all regions:

Regional Drill-Down

Compare performance by region:
This reveals:
  • Alchemy is fastest in US-East
  • Higher latency in EU-West and AP-Southeast
  • Consider regional provider alternatives (e.g., EU-specific providers)

Circuit Breaker Isolation

Circuit breakers are per-node, providing regional fault isolation: Scenario: Alchemy has an outage in EU-West but is healthy in other regions.
Result:
  • EU-West node fails over to Infura or LlamaRPC
  • US-East and AP-Southeast continue using Alchemy
  • No cross-region coordination needed

Scaling Patterns

Horizontal Scaling Within Region

Run multiple nodes per region behind a load balancer:
Characteristics:
  • Same LASSO_NODE_ID for all nodes in the region
  • Metrics aggregate at the region level
  • Stateless request handling (no sticky sessions needed)

Vertical Scaling

Increase resources per node:
  • BEAM scheduler cores: Set --erl "+S 8:8" for 8 schedulers
  • Memory: Increase container/VM memory for larger metric stores
  • Connection pools: Tune Finch pool sizes in config/runtime.exs

Monitoring and Observability

Health Checks Per Region

Configure health checks in each region’s load balancer:

Regional Metrics

Key metrics to monitor per region:
  • Request rate: Requests/second per region
  • Latency: P50, P95, P99 per provider per region
  • Circuit breaker state: Open breakers indicate regional issues
  • Provider availability: Percentage of healthy providers
  • Cluster connectivity: Node states (:responding, :unresponsive)

Unified Dashboard

When clustering is enabled, access the dashboard from any node to see cluster-wide metrics:

Disaster Recovery

Regional Failover

If an entire region goes down:
  1. GeoDNS/Load balancer detects unhealthy region
  2. Traffic routes to next-nearest region
  3. Clients reconnect to fallback region
  4. No manual intervention required

Degraded Mode

If clustering fails but nodes are healthy:
  • Each node continues routing independently
  • Dashboard shows local metrics only
  • Applications unaffected (routing unchanged)
  • Fix cluster networking to restore aggregation

Best Practices

  1. Use stable node IDs: Match cloud region codes (us-east-1, not node-1)
  2. Deploy at least 3 regions: Provides global coverage and redundancy
  3. Monitor regional performance: Identify geographic provider issues
  4. Test cross-region failover: Simulate region outages
  5. Plan network topology: Ensure low-latency cluster communication
  6. Use regional provider endpoints: Some providers have regional URLs

Cost Optimization

Provider Selection by Region

Some providers offer better pricing or performance in specific regions:

Request Volume Balancing

Distribute traffic based on regional request volumes:
  • Deploy more nodes in high-traffic regions
  • Use cheaper providers in low-traffic regions
  • Monitor cost per region in cloud billing

Next Steps