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

Terminal
cargo install solidb

2 From Source

Terminal
$git clone https://github.com/solisoft/solidb
$cd solidb
$cargo build --release

3 Using Docker

Terminal
$docker run -d --name solidb \
-p 6745:6745 \
-v solidb-data:/data \
solidb/solidb:latest

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

$ git clone https://github.com/solisoft/solidb
$ cd solidb
$ docker build -t solidb/solidb:latest .

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.

# Generate shared keyfile for cluster auth
$ openssl rand -hex 32 > solidb.key
# Start 3-node cluster
$ docker-compose -f docker-compose-cluster.yml up -d
Node 1
localhost:6745
Node 2
localhost:6746
Node 3
localhost:6747

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

solidb-0
PVC: data-solidb-0
solidb-1
PVC: data-solidb-1
solidb-2
PVC: data-solidb-2
solidb (ClusterIP)
Client connections
solidb-headless
Peer DNS discovery

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

./target/release/solidb --port 8080

Check the terminal output for the generated admin password. You will need it to authenticate.

2. Create Database

curl -X POST http://localhost:8080/_api/database -d '{"name": "mydb"}'

Creates a new database namespace called "mydb".

3. Insert Document

curl -X POST http://localhost:8080/_api/document/mydb/users \
  -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

SOLIDB_ADMIN_PASSWORD=my_secure_password JWT_SECRET=your-secure-jwt-secret-32-chars-min QUEUE_WORKERS=8

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.

# Generate a keyfile
openssl rand -hex 32 > solidb.key
# Start with keyfile
./solidb --keyfile solidb.key --cluster-peers "node2:6746"

Next Steps