Architecture Overview
High-Level Architecture
┌─────────────────────────────────────────────────────────────────────────────────┐
│ END USERS (Enterprise Customers) │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ HTTP Client │ │ TCP Client │ │ SDK/CLI │ │ Web Console │ │
│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
└──────────┼──────────────────┼──────────────────┼──────────────────┼───────────┘
│ │ │ │
▼ ▼ ▼ ▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│ CLOUDFLARE GLOBAL NETWORK │
│ ┌───────────────────────────────────────────────────────────────────────────┐ │
│ │ ROUTING LAYER │ │
│ │ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │ │
│ │ │ HTTP Router │ │ TCP Router │ │ WebSocket │ │ │
│ │ │ (Workers) │ │ (Spectrum+DO) │ │ Gateway │ │ │
│ │ └────────┬────────┘ └────────┬────────┘ └────────┬────────┘ │ │
│ └───────────┼────────────────────┼────────────────────┼────────────────────┘ │
│ │ │ │ │
│ ┌───────────┴────────────────────┴────────────────────┴────────────────────┐ │
│ │ CONTROL PLANE │ │
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │
│ │ │ Workload │ │ Price │ │ Health │ │ Auth │ │ │
│ │ │ Orchestrator │ │ Arbitrage │ │ Monitor │ │ Service │ │ │
│ │ │ (Workflows) │ │ Engine (DO) │ │ (Workers) │ │ (Workers) │ │ │
│ │ └──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘ │ │
│ └───────────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────────────────────────────┐ │
│ │ DATA LAYER │ │
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │
│ │ │ D1 │ │ KV │ │ Durable │ │ R2 │ │ │
│ │ │ (Workloads) │ │ (Routing) │ │ Objects │ │ (Artifacts) │ │ │
│ │ │ │ │ │ │ (State) │ │ │ │ │
│ │ └──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘ │ │
│ └───────────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────────┐
│ KIVERA PROXY LAYER │
│ ┌──────────────────────────────────────────────────────────────────────────┐ │
│ │ Policy Enforcement • Data Boundaries • Audit Logging • Compliance │ │
│ └──────────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────────┘
│
┌──────────────────────────┼──────────────────────────┐
▼ ▼ ▼
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
│ AWS │ │ AZURE │ │ GCP │
│ ┌───────────────┐ │ │ ┌───────────────┐ │ │ ┌───────────────┐ │
│ │ EC2 Spot │ │ │ │ Spot VMs │ │ │ │ Preemptible │ │
│ │ Instances │ │ │ │ │ │ │ │ VMs │ │
│ └───────────────┘ │ │ └───────────────┘ │ │ └───────────────┘ │
│ ┌───────────────┐ │ │ ┌───────────────┐ │ │ ┌───────────────┐ │
│ │ VPC/Subnets │ │ │ │ VNet/Subnets │ │ │ │ VPC/Subnets │ │
│ └───────────────┘ │ │ └───────────────┘ │ │ └───────────────┘ │
│ ┌───────────────┐ │ │ ┌───────────────┐ │ │ ┌───────────────┐ │
│ │ IAM Roles │ │ │ │ Managed │ │ │ │ Service │ │
│ │ │ │ │ │ Identities │ │ │ │ Accounts │ │
│ └───────────────┘ │ │ └───────────────┘ │ │ └───────────────┘ │
└─────────────────────┘ └─────────────────────┘ └─────────────────────┘
Design Principles
- Stateless routing, stateful coordination - Routing decisions cached in KV, complex state in Durable Objects
- Eventually consistent with strong guarantees - Price data cached, routing updates propagate globally in <1s
- Graceful degradation - System continues operating even if price feeds are delayed
- Security by default - All cloud operations routed through Kivera for policy enforcement
- Multi-tenant isolation - Each customer operates in isolated cloud accounts/projects