Getting Started
Get up and running with SoliDB in minutes. Learn the basics of installation, connecting, and running your first queries.
Installation
1 Using Cargo
cargo install solidb
2 From Source
3 Using Docker
Docker Compose: For production deployments, use docker-compose.yml from the repository.
Docker Deployment
SoliDB provides official Docker images for easy deployment in containerized environments.
Docker Compose (Recommended)
version: '3.8'
services:
solidb:
image: solidb/solidb:latest
ports:
- "6745:6745"
volumes:
- solidb-data:/data
environment:
- SOLIDB_PORT=6745
- RUST_LOG=solidb=info
restart: unless-stopped
volumes:
solidb-data:
Environment Variables
| Variable | Default | Description |
|---|---|---|
| SOLIDB_PORT | 6745 | HTTP server port |
| SOLIDB_DATA_DIR | /data | Data directory path |
| SOLIDB_LOG_LEVEL | info | Log verbosity level |
| SOLIDB_ADMIN_PASSWORD | auto-generated | Admin user password |
Build Image Locally
Health Check: The Docker image includes a built-in health check at
/_api/health. Container orchestrators can use this to monitor instance health.
Docker Cluster Setup
For high availability, use the cluster compose file to run multiple nodes.
Kubernetes Deployment
Deploy SoliDB on Kubernetes using the provided manifests for single-node or cluster deployments.
Single Node Deployment
# Apply manifests kubectl apply -f k8s/namespace.yaml kubectl apply -f k8s/configmap.yaml kubectl apply -f k8s/secret.yaml kubectl apply -f k8s/single/ # Verify deployment kubectl -n solidb get pods kubectl -n solidb port-forward svc/solidb 6745:6745
Cluster Deployment (StatefulSet)
Uses StatefulSet with headless service for automatic peer discovery via DNS.
# Generate keyfile for cluster auth openssl rand -hex 32 > keyfile.txt # Create secret with keyfile kubectl create namespace solidb kubectl create secret generic solidb-secret \ -n solidb --from-file=keyfile=keyfile.txt # Deploy 3-node cluster kubectl apply -f k8s/configmap.yaml kubectl apply -f k8s/cluster/ # Watch pods come up kubectl -n solidb get pods -w
Cluster Architecture
Included Features
- • Liveness & readiness probes
- • Prometheus annotations
- • Pod anti-affinity
- • PodDisruptionBudget
Scaling
kubectl -n solidb scale statefulset solidb --replicas=5
Basic Usage
Start the server and interact with the HTTP API using curl or your preferred client.
1. Start Server
Check the terminal output for the generated admin password. You will need it to authenticate.
2. Create Database
Creates a new database namespace called "mydb".
3. Insert Document
-d '{"name": "Alice", "age": 30, "city": "Paris"}'
Inserts a JSON document into the "users" collection within "mydb".
Configuration
SoliDB can be configured using command-line arguments, environment
variables, or an .env file
located in the same directory as the executable.
Environment Variables
| Variable | Description |
|---|---|
| SOLIDB_ADMIN_PASSWORD | Overrides the auto-generated admin password. |
| JWT_SECRET | Secret for signing JSON Web Tokens (32+ chars recommended). |
| SOLIDB_CLUSTER_SCHEME | Protocol for cluster traffic (http or https). |
| QUEUE_WORKERS | Concurrent workers per node (default: 4). |
Example .env
Cluster Authentication (Keyfile)
For cluster mode, inter-node authentication uses a shared keyfile instead of environment variables. All nodes must use the same keyfile content.
openssl rand -hex 32 > solidb.key
./solidb --keyfile solidb.key --cluster-peers "node2:6746"