Cloud Application API Β· Multi-Runtime Sidecar Β· Write Once, Run Anywhere
Capa Java Β· Capa Python Β· Capa Go
Capa Runtime is the sidecar implementation of the Capa (Cloud Application API) ecosystem. It provides extended capabilities that complement the Capa SDK, enabling advanced features like traffic interception, Actor model, and external system bindings.
Capa Runtime works alongside Capa SDK implementations to provide a complete Multi-Runtime solution for cloud-native applications.
| Mode | Description | Use Case |
|---|---|---|
| SDK Mode | Direct API calls via Capa SDK | Standard operations, low latency |
| Sidecar Mode | Capa Runtime provides extended APIs | Actor, Binding, Traffic interception |
capa/
βββ cmd/ # Entry points and CLI commands
βββ pkg/ # Core packages
β βββ actor/ # Actor runtime implementation
β βββ binding/ # External system bindings
β βββ proxy/ # Traffic proxy and interception
β βββ runtime/ # Core runtime logic
β βββ saas/ # SaaS integrations
βββ docker/ # Docker configurations
βββ spec/ # API specifications
βββ utils/ # Utility functions
Key Design Principles:
- Optional Sidecar: Capa Runtime is optional; SDK works independently
- Extended Capabilities: Provides APIs that SDK cannot support
- Dual Mode: Supports both sidecar and proxyless modes
- Negotiation: Application negotiates with proxy to determine mode
| Feature | Description | Status |
|---|---|---|
| iptables Integration | L7 HTTP traffic interception | π¬ Experimental |
| Traffic Analysis | Monitor and analyze request flow | π¬ Experimental |
| Request Routing | Dynamic traffic routing | π¬ Experimental |
β οΈ Warning: This feature affects the main traffic path. Use with caution in production.
| Feature | Description | Status |
|---|---|---|
| Virtual Actors | Dapr-style virtual actor model | β Stable |
| State Management | Actor state persistence | β Stable |
| Reminders | Scheduled actor callbacks | β Stable |
| Concurrency | Turn-based concurrency | β Stable |
Actor model is not suitable for SDK integration and is provided via runtime.
| Feature | Description | Status |
|---|---|---|
| Input Bindings | Trigger from external sources | β Stable |
| Output Bindings | Send to external systems | β Stable |
| Extensibility | Pluggable binding components | β Stable |
Binding provides loosely-coupled interaction with external systems.
| Feature | Description | Status |
|---|---|---|
| SaaS Connectors | Pre-built SaaS integrations | π¬ Experimental |
| Data Sync | Bi-directional data synchronization | π¬ Experimental |
| Webhook Support | Event-driven SaaS interactions | π¬ Experimental |
While Capa SDK provides rich functionality, some capabilities require sidecar architecture:
- Actor Model: Requires persistent connections and scheduling
- Traffic Interception: Needs network-level control (iptables)
- Binding: Benefits from decoupled event processing
| Capability | SDK | Sidecar | Notes |
|---|---|---|---|
| RPC | β | β | SDK preferred for performance |
| Configuration | β | β | SDK preferred |
| Pub/Sub | β | β | SDK preferred |
| Actor | β | β | Only sidecar |
| Binding | β | β | Sidecar for async |
| Traffic Interception | β | β | Only sidecar |
- Go 1.18 or higher
- Docker (optional, for containerized deployment)
- Kubernetes (optional, for orchestrated deployment)
# Clone the repository
git clone https://github.com/capa-cloud/capa.git
cd capa
# Build the runtime
go build -o capa-runtime ./cmd
# Run locally
./capa-runtime --config ./config.yaml# Build Docker image
docker build -t capa-runtime:latest .
# Run container
docker run -d \
--name capa-runtime \
-p 3500:3500 \
-v $(pwd)/config:/config \
capa-runtime:latestapiVersion: apps/v1
kind: Deployment
metadata:
name: capa-runtime
spec:
replicas: 1
selector:
matchLabels:
app: capa-runtime
template:
metadata:
labels:
app: capa-runtime
spec:
containers:
- name: capa-runtime
image: capa-runtime:latest
ports:
- containerPort: 3500
---
apiVersion: v1
kind: Service
metadata:
name: capa-runtime
spec:
selector:
app: capa-runtime
ports:
- port: 3500
targetPort: 3500Capa Runtime minimizes external dependencies. Instead of a dedicated control plane, it uses:
- Configuration Component: For dynamic configuration delivery
- Service Discovery: Built-in or via external registry
mode: sidecar
sidecar:
port: 3500
grpcPort: 50001
metricsPort: 9090
traffic:
interception:
enabled: true
port: 80mode: proxyless
proxyless:
directConnection: true
sdkEndpoints:
- localhost:3500The application negotiates with the proxy to determine the operating mode:
// Application requests mode preference
mode := runtime.NegotiateMode(
runtime.WithPreference(runtime.SDKMode),
runtime.WithFallback(runtime.SidecarMode),
)// Initialize actor runtime
actorRuntime := runtime.NewActorRuntime()
// Register actor type
actorRuntime.RegisterActor("MyActor", &MyActor{})
// Invoke actor method
response, err := actorRuntime.Invoke(
ctx,
"MyActor",
"actor-id-123",
"DoWork",
[]byte("payload"),
)// Initialize binding
binding := runtime.NewBinding("kafka-binding")
// Send to external system
err := binding.Send(ctx, &runtime.InvokeRequest{
Data: []byte("message"),
Metadata: map[string]string{
"topic": "orders",
},
})
// Receive from external system
binding.Receive(func(req *runtime.InvokeRequest) (*runtime.InvokeResponse, error) {
// Process incoming message
return &runtime.InvokeResponse{Data: []byte("ack")}, nil
})Capa Runtime is part of the Capa Cloud ecosystem:
| Project | Language | Description |
|---|---|---|
| capa-java | Java | Java SDK implementation |
| capa-python | Python | Python SDK implementation |
| capa-go | Go | Go SDK implementation |
| cloud-runtimes-jvm | Java | JVM API specification |
| cloud-runtimes-golang | Go | Go API specification |
We welcome contributions to Capa Runtime!
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone and build
git clone https://github.com/capa-cloud/capa.git
cd capa
# Download dependencies
go mod download
# Run tests
go test ./...
# Build binary
go build -o capa-runtime ./cmdThis project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Building the future of cloud-native applications with Multi-Runtime architecture

