High Availability & Replication
Running multiple stateless KOLMOS replicas over shared Cloud Object storage.
1. HA Architecture: Stateless Replicas over Shared Object Storage
High availability in KOLMOS comes from running multiple stateless, equal container replicas pointed at the **same** shared cloud object storage bucket. Cloud object storage provides 11 9s durability and multi-AZ erasure coding out of the box, so KOLMOS replicas focus entirely on high-throughput query execution and prompt catalog synchronization.
2. The Background Refresh Worker
Each replica runs a background worker that periodically catches its in-memory catalog up to the bucket's current HEAD, picking up commits any peer has written. This makes cross-replica writes visible across all nodes while atomic catalog swaps ensure concurrent writes remain completely safe.
docker run -d -p 5432:5432 -p 3306:3306 -p 27017:27017 \
-e S3_BUCKET=kolmos-prod -e S3_REGION=auto \
-e REFRESH_INTERVAL_SECS=5 \
kolmos/kolmos:latest3. Health Checks for Load Balancers
`GET /healthz` on the `--metrics-port` listener returns 200 while the bucket is reachable and the refresh worker isn't failing, and 503 otherwise — wire it up as your load balancer or Kubernetes readiness/liveness probe so traffic drains away from a replica that's lost bucket connectivity.
curl http://127.0.0.1:9090/healthz4. Known Limitations (v1)
- No leader lease: background vacuum runs redundantly on every replica. Safe, but wastes some compute — expect this to be optimized in a future release. - Consistency is eventual, not linearizable — don't assume read-your-own-write across two different replica connections without routing sticky sessions. - `--store local` cannot be scaled this way; multi-replica HA requires shared Cloud Object-compatible storage.
5. Example: 3-Replica Kubernetes Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: kolmos
spec:
replicas: 3
selector:
matchLabels: { app: kolmos }
template:
metadata:
labels: { app: kolmos }
spec:
containers:
- name: kolmos
image: kolmos/kolmos:latest
args: ["--root", "/data", "serve", "--host", "0.0.0.0",
"--store", "s3", "--s3-bucket", "kolmos-prod",
"--metrics-port", "9090"]
readinessProbe:
httpGet: { path: /healthz, port: 9090 }
livenessProbe:
httpGet: { path: /healthz, port: 9090 }
---
apiVersion: v1
kind: Service
metadata:
name: kolmos
spec:
selector: { app: kolmos }
ports:
- { name: postgres, port: 5432, targetPort: 5432 }