Rustberg
Why Rustberg?
Rustberg is a production-grade Apache Iceberg REST Catalog designed for simplicity and performance:
Core Capabilities
- π Instant Startup β Sub-10ms cold start, ready immediately
- π¦ Single Binary β No JVM, no PostgreSQL, no external services required
- π Security First β TLS 1.3, API keys, JWT/OIDC, Cedar policies, AES-256-GCM encryption
- βΈοΈ Kubernetes Native β SlateDB on S3/GCS/Azure for horizontal scaling
- π Cross-Platform β Linux, macOS, Windows with first-class support
- π Full Iceberg REST API β Tables, views, namespaces, transactions, credential vending
Quick Start
Option 1: Pre-built Binaries
# Linux (x86_64)
# Linux (ARM64)
# macOS (Apple Silicon)
# Make executable and run
Option 2: Docker
# Start Rustberg
# Verify it's running
# Create a namespace
Option 3: Helm Chart (Kubernetes)
# Clone repository
# Install with Helm
# Or with custom values
Option 4: Build from Source
Requires Rust 1.89+ (install)
# Clone and build
# Generate TLS certificate (development)
# Start server
Features
Core Iceberg API
- β Namespace CRUD - Create, list, update, delete namespaces
- β Table CRUD - Full table lifecycle management
- β Table Commits - Optimistic concurrency with requirements
- β Register Table - Import existing tables from metadata location
- β Multi-table Transactions - Atomic commits across multiple tables
- β Metrics Reporting - Client telemetry collection
- β Credential Vending - AWS STS + GCS + Azure temporary credentials
- β Pagination - Cursor-based with configurable page size
- β Idempotency - Request deduplication via idempotency keys
Security
- β API Key Authentication - Argon2id hashed, constant-time validation
- β JWT/OIDC Authentication - JWKS validation, configurable claims
- β Cedar Policy Authorization - Fine-grained ABAC beyond simple RBAC
- β Multi-Tenancy - Hard isolation between tenants
- β Rate Limiting - Token bucket per IP/tenant
- β Encryption at Rest - AES-256-GCM with envelope encryption + AWS KMS
- β TLS/HTTPS - TLS 1.2/1.3 via rustls
- β Security Headers - CSP, X-Frame-Options, X-Content-Type-Options
- β CORS Support - Configurable cross-origin resource sharing
- β Audit Logging - Structured JSON for SIEM
Operations
- β
Health Checks -
/healthand/readyendpoints - β
Metrics - Prometheus-compatible
/metricswith 25+ counters - β Request Tracing - X-Request-Id propagation for distributed tracing
- β Response Compression - Gzip/deflate/brotli automatic compression
- β Graceful Shutdown - SIGTERM handling with connection drain
- β Backup/Restore - CLI commands for disaster recovery
- β TOML Configuration - File-based config with env override
Security
Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SECURITY LAYERS β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β TLS 1.2/1.3 (rustls) Transport Security β
β βββ Rate Limiting (token bucket) DoS Protection β
β βββ Request Size Limits (10MB) Resource Protection β
β βββ Request Timeouts (30s) Hang Protection β
β βββ Security Headers (CSP, X-Frame-Options) Browser Security β
β βββ X-Request-Id Tracing Distributed Tracing β
β βββ CORS Middleware Cross-Origin Policy β
β βββ API Key / JWT Authentication Identity β
β βββ Cedar Policy Authorization Access Control β
β βββ Input Validation Injection Defense β
β βββ Audit Logging Forensics β
β βββ AES-256-GCM Encryption Data at Rest β
β βββ KMS (env/AWS/Vault) + Circuit Breaker Key Management β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Authentication
# Generate an API key
# Use the key
Authorization (Cedar Policies)
// Allow readers to list namespaces
permit(
principal,
action == Action::"ListNamespaces",
resource
) when {
principal.roles.contains("reader")
};
// Deny cross-tenant access
forbid(
principal,
action,
resource
) when {
principal.tenant_id != resource.tenant_id
};
API
Endpoints
| Method | Path | Description |
|---|---|---|
GET |
/health |
Liveness check |
GET |
/ready |
Readiness check with dependencies |
GET |
/metrics |
Prometheus metrics |
GET |
/v1/config |
Catalog configuration |
GET |
/v1/namespaces |
List namespaces |
POST |
/v1/namespaces |
Create namespace |
GET |
/v1/namespaces/{ns} |
Get namespace |
POST |
/v1/namespaces/{ns} |
Update namespace |
DELETE |
/v1/namespaces/{ns} |
Delete namespace |
GET |
/v1/namespaces/{ns}/tables |
List tables |
POST |
/v1/namespaces/{ns}/tables |
Create table |
POST |
/v1/namespaces/{ns}/register |
Register existing table |
GET |
/v1/namespaces/{ns}/tables/{table} |
Load table |
DELETE |
/v1/namespaces/{ns}/tables/{table} |
Drop table |
POST |
/v1/namespaces/{ns}/tables/{table} |
Commit table update |
HEAD |
/v1/namespaces/{ns}/tables/{table} |
Check table exists |
POST |
/v1/namespaces/{ns}/tables/{table}/metrics |
Report metrics |
POST |
/v1/tables/rename |
Rename table |
POST |
/v1/transactions/commit |
Multi-table transaction |
Example: Create a Table
Configuration
TOML Configuration File
# rustberg.toml
[]
= "0.0.0.0"
= 8000
[]
= true
= false
[]
= true
= "/etc/rustberg/tls/cert.pem"
= "/etc/rustberg/tls/key.pem"
[]
# Single-node (local storage)
= "file:///var/lib/rustberg/data"
# K8s HA (S3-compatible)
# backend = "s3://rustberg-bucket/catalog?region=us-east-1"
[]
= "env" # or "aws-kms", "vault"
= 300
= true
[]
= true
= 100
= 200
[]
= "info"
= false
Environment Variables
| Variable | Default | Description |
|---|---|---|
RUSTBERG_HOST |
0.0.0.0 |
Bind address |
RUSTBERG_PORT |
8000 |
Bind port |
RUSTBERG_WAREHOUSE |
- | Warehouse location |
RUSTBERG_TENANT_ID |
default |
Default tenant |
RUSTBERG_NO_AUTH |
false |
Disable authentication (dev only) |
RUSTBERG_TLS_CERT |
- | TLS certificate path |
RUSTBERG_TLS_KEY |
- | TLS key path |
RUSTBERG_INSECURE_HTTP |
false |
Allow HTTP (dev only) |
RUSTBERG_MASTER_KEY |
- | Encryption master key (hex) |
RUST_LOG |
info |
Log level |
Deployment
Production Checklist
- TLS enabled with valid certificates
- Authentication enabled (default - ensure
RUSTBERG_NO_AUTHis NOT set) - Master key stored securely (KMS recommended)
- Rate limiting configured appropriately
- Audit logging to persistent storage
- Health checks configured in orchestrator
- Backup schedule established
Kubernetes
Rustberg supports both single-node (with PVC) and highly-available (with S3) deployments:
Single-Node (PVC Storage)
apiVersion: apps/v1
kind: Deployment
metadata:
name: rustberg
spec:
replicas: 1 # Single node only with file:// storage
template:
spec:
containers:
- name: rustberg
image: ghcr.io/hupe1980/rustberg:latest
ports:
- containerPort: 8000
env:
- name: STORAGE_BACKEND
value: "file:///var/lib/rustberg/data"
- name: RUSTBERG_MASTER_KEY
valueFrom:
secretKeyRef:
name: rustberg-secrets
key: master-key
volumeMounts:
- name: data
mountPath: /var/lib/rustberg/data
volumes:
- name: data
persistentVolumeClaim:
claimName: rustberg-data
High-Availability (S3/GCS/MinIO)
apiVersion: apps/v1
kind: Deployment
metadata:
name: rustberg
spec:
replicas: 3 # Multiple replicas with shared S3 storage
template:
spec:
containers:
- name: rustberg
image: ghcr.io/hupe1980/rustberg:latest
ports:
- containerPort: 8000
env:
- name: STORAGE_BACKEND
value: "s3://rustberg-bucket/catalog?region=us-east-1"
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: rustberg-secrets
key: aws-access-key
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: rustberg-secrets
key: aws-secret-key
- name: RUSTBERG_MASTER_KEY
valueFrom:
secretKeyRef:
name: rustberg-secrets
key: master-key
livenessProbe:
httpGet:
path: /health
port: 8000
initialDelaySeconds: 5
readinessProbe:
httpGet:
path: /ready
port: 8000
initialDelaySeconds: 5
Backup & Restore
# Create backup
# Validate backup
# Restore (stops server first!)
CLI Reference
# Start server
# Generate API key
# Generate TLS certificate (development)
# Generate sample configuration file
# Generate OpenAPI specification
# Backup catalog
# Restore catalog
# Validate backup
# Show status
# Run performance benchmark
Engine Compatibility
| Engine | Read | Write | Notes |
|---|---|---|---|
| PyIceberg | β | β | Full support |
| Trino | β | β | Full support |
| DuckDB | β | - | Read-only |
Development
# Run tests
# Run with debug logging
RUST_LOG=debug
# Format code
# Lint
License
Apache License 2.0