Why Use Oso Fallback?
Authorization sits on your application’s critical path. Oso Cloud delivers 99.99% uptime across multiple regions and availability zones. But network partitions happen. Oso Fallback ensures your applications keep running when they can’t reach Oso Cloud.How Oso Fallback Works
Oso Fallback nodes are read-only instances that sync your policies and facts every 30 minutes. They may lag behind Oso Cloud during the sync interval. Use fallback nodes as last resort backup only. Continue making authorization calls to Oso Cloud during normal operations. Deploy multiple fallback nodes behind a load balancer for horizontal scaling. Each node operates independently.Configure load balancers with session affinity. Different nodes may have facts that are up to one minute out of sync.
System Requirements
Minimum specs per node:- CPU: 1 core
- Memory: 256MB RAM
- Disk: 3x your environment size
Check Your Environment Size
Find your environment size on the Fallback status page. Allocate 3x this size for growth headroom and atomic updates.Storage Types
- Ephemeral storage: Node downloads facts on startup. Fails to start if Oso Cloud is unreachable.
- Persistent storage: Node starts from existing facts on disk. Survives Oso Cloud outages and restarts.
Quick Start
Deploy Oso Fallback in three steps:-
Pull the Docker image
-
Set required environment variables
-
Run the container
http://localhost:8080
.
Update Your Client SDK
Configure your Oso Cloud client to use the fallback automatically:Offline snapshots for guaranteed startup
Export snapshots to ensure new nodes start even when Oso Cloud is down:--import
option provides a fallback when Oso Cloud is unreachable.
Configuration Reference
Required Environment Variables
Variable | Description | Where to Find |
---|---|---|
OSO_API_TOKEN | Read-only API key for your environment | Create new API key |
OSO_ENVIRONMENT | Your environment ID | Environments page |
OSO_TENANT | Your tenant ID | Settings page |
Optional Environment Variables
Variable | Default | Options | Description |
---|---|---|---|
OSO_CLIENT_ID | Random UUID | a-zA-Z0-9.- | Unique identifier per node. Must be unique per restart. |
OSO_PORT | 8080 | 0-65535 | Port for the fallback node |
OSO_DIRECTORY | ./.oso | Valid path | Facts storage directory |
OSO_LOG_LEVEL | error | info, warn, error | Log verbosity |
OSO_DISABLE_TELEMETRY | false | true, false | Disable usage data collection |
OSO_DISABLE_ERROR_LOGGING | false | true, false | Disable error log collection |
Load Balancer Configuration
Health check endpoint:/healthcheck
Returns 200 OK
only after loading valid policies and facts. Configure a health check grace period for initial startup.
Session affinity recommended. Prevents inconsistent responses from nodes with different sync states.
Scaling Guidelines
CPU Scaling
Scale horizontally by adding nodes or vertically by adding cores per node.- Monitor: Average CPU across all nodes
- Scale trigger: >80% CPU utilization
- Consider: Startup time for downloading facts when autoscaling
Memory Sizing
Fallback nodes use minimal baseline memory plus in-memory caches for query performance.- Monitor: Maximum memory utilization across all nodes
- Scale trigger: >80% memory utilization
- Cache size depends on: Query diversity in your application
Disk Sizing
Nodes download new facts while keeping current facts active. This temporarily doubles disk usage.- Monitor: Disk utilization across all nodes
- Scale trigger: >65% disk utilization
- Recommendation: Use low-latency, high-throughput volumes
Monitoring
Health Checks
- Endpoint:
/healthcheck
- Healthy response:
200 OK
- Ready when: Valid policies and facts loaded
Prometheus Metrics
- Endpoint:
/metrics
Key metrics
oso_fallback_snapshot_age_ms
- Age of your policies and facts in milliseconds
oso_fallback_http_requests
- HTTP response latency histogram
Monitor for: Increasing snapshot age indicates sync issues
Testing Your Setup
Verify fallback activation with chaos testing:- Block Oso Cloud access using proxies or unresolvable hostnames in your client configuration
- Make authorization requests through your application
- Check the
oso_fallback_http_requests
metric to confirm fallback usage