←Back to Documentation

Deployment Guide

Deploy entropyDB in various environments from local development to production-grade multi-region clusters

Overview

entropyDB supports multiple deployment models to fit your infrastructure needs:

  • • Docker: Quick local development and testing
  • • Kubernetes: Production-ready container orchestration
  • • Cloud Managed: Fully managed service on AWS, Azure, GCP
  • • Bare Metal: Maximum performance for dedicated hardware
  • • Multi-Region: Global distribution with low latency

Docker Deployment

Single Container

Perfect for development and testing:

# Run entropyDB with persistent storage
docker run -d \
  --name entropydb \
  -p 5432:5432 \
  -p 8080:8080 \
  -e ENTROPY_PASSWORD=your_password \
  -v entropy_data:/var/lib/entropydb \
  entropydb/entropydb:latest

# Check status
docker logs entropydb

# Connect to database
docker exec -it entropydb entropy-cli

Docker Compose

Multi-node cluster with monitoring:

version: '3.8'

services:
  entropy-node-1:
    image: entropydb/entropydb:latest
    environment:
      - ENTROPY_NODE_ID=1
      - ENTROPY_CLUSTER_NODES=entropy-node-1,entropy-node-2,entropy-node-3
      - ENTROPY_DATA_DIR=/data
      - ENTROPY_PASSWORD=${ENTROPY_PASSWORD}
    ports:
      - "5432:5432"
      - "8080:8080"
    volumes:
      - entropy_data_1:/data
    networks:
      - entropy_cluster

  entropy-node-2:
    image: entropydb/entropydb:latest
    environment:
      - ENTROPY_NODE_ID=2
      - ENTROPY_CLUSTER_NODES=entropy-node-1,entropy-node-2,entropy-node-3
      - ENTROPY_DATA_DIR=/data
      - ENTROPY_PASSWORD=${ENTROPY_PASSWORD}
    ports:
      - "5433:5432"
      - "8081:8080"
    volumes:
      - entropy_data_2:/data
    networks:
      - entropy_cluster

  entropy-node-3:
    image: entropydb/entropydb:latest
    environment:
      - ENTROPY_NODE_ID=3
      - ENTROPY_CLUSTER_NODES=entropy-node-1,entropy-node-2,entropy-node-3
      - ENTROPY_DATA_DIR=/data
      - ENTROPY_PASSWORD=${ENTROPY_PASSWORD}
    ports:
      - "5434:5432"
      - "8082:8080"
    volumes:
      - entropy_data_3:/data
    networks:
      - entropy_cluster

  prometheus:
    image: prom/prometheus:latest
    ports:
      - "9090:9090"
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
      - prometheus_data:/prometheus
    networks:
      - entropy_cluster

  grafana:
    image: grafana/grafana:latest
    ports:
      - "3000:3000"
    volumes:
      - grafana_data:/var/lib/grafana
    networks:
      - entropy_cluster

volumes:
  entropy_data_1:
  entropy_data_2:
  entropy_data_3:
  prometheus_data:
  grafana_data:

networks:
  entropy_cluster:
    driver: bridge
# Start the cluster
docker-compose up -d

# Scale to 5 nodes
docker-compose up -d --scale entropy-node-1=5

# View logs
docker-compose logs -f entropy-node-1

# Stop cluster
docker-compose down

Kubernetes Deployment

Helm Chart

Production-ready Kubernetes deployment:

# Add entropyDB Helm repository
helm repo add entropydb https://charts.entropydb.io
helm repo update

# Install with default configuration
helm install entropydb entropydb/entropydb \
  --namespace entropydb \
  --create-namespace

# Install with custom values
helm install entropydb entropydb/entropydb \
  --namespace entropydb \
  --create-namespace \
  --values values.yaml

# Upgrade deployment
helm upgrade entropydb entropydb/entropydb \
  --namespace entropydb \
  --values values.yaml

# Uninstall
helm uninstall entropydb --namespace entropydb

Custom Values

Configure your deployment with values.yaml:

# values.yaml
replicaCount: 3

image:
  repository: entropydb/entropydb
  tag: "1.0.0"
  pullPolicy: IfNotPresent

resources:
  requests:
    memory: "4Gi"
    cpu: "2000m"
  limits:
    memory: "8Gi"
    cpu: "4000m"

storage:
  size: 100Gi
  storageClass: fast-ssd
  
persistence:
  enabled: true
  storageClass: standard
  accessMode: ReadWriteOnce
  size: 500Gi

service:
  type: LoadBalancer
  port: 5432
  httpPort: 8080

ingress:
  enabled: true
  className: nginx
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
  hosts:
    - host: entropydb.example.com
      paths:
        - path: /
          pathType: Prefix
  tls:
    - secretName: entropydb-tls
      hosts:
        - entropydb.example.com

monitoring:
  enabled: true
  serviceMonitor:
    enabled: true
    interval: 30s

backup:
  enabled: true
  schedule: "0 2 * * *"
  retention: 30

autoscaling:
  enabled: true
  minReplicas: 3
  maxReplicas: 10
  targetCPUUtilizationPercentage: 70
  targetMemoryUtilizationPercentage: 80

affinity:
  podAntiAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          labelSelector:
            matchLabels:
              app: entropydb
          topologyKey: kubernetes.io/hostname

StatefulSet Configuration

For manual deployment without Helm:

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: entropydb
  namespace: entropydb
spec:
  serviceName: entropydb
  replicas: 3
  selector:
    matchLabels:
      app: entropydb
  template:
    metadata:
      labels:
        app: entropydb
    spec:
      containers:
      - name: entropydb
        image: entropydb/entropydb:latest
        ports:
        - containerPort: 5432
          name: postgres
        - containerPort: 8080
          name: http
        env:
        - name: ENTROPY_NODE_ID
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: ENTROPY_CLUSTER_NODES
          value: "entropydb-0.entropydb,entropydb-1.entropydb,entropydb-2.entropydb"
        - name: ENTROPY_PASSWORD
          valueFrom:
            secretKeyRef:
              name: entropydb-secret
              key: password
        volumeMounts:
        - name: data
          mountPath: /var/lib/entropydb
        resources:
          requests:
            memory: "4Gi"
            cpu: "2000m"
          limits:
            memory: "8Gi"
            cpu: "4000m"
        livenessProbe:
          httpGet:
            path: /health
            port: 8080
          initialDelaySeconds: 30
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /ready
            port: 8080
          initialDelaySeconds: 10
          periodSeconds: 5
  volumeClaimTemplates:
  - metadata:
      name: data
    spec:
      accessModes: ["ReadWriteOnce"]
      storageClassName: fast-ssd
      resources:
        requests:
          storage: 500Gi

Cloud Managed Deployment

AWS Deployment

# Using AWS EKS
eksctl create cluster \
  --name entropydb-cluster \
  --region us-west-2 \
  --nodegroup-name entropydb-nodes \
  --node-type m5.2xlarge \
  --nodes 3 \
  --nodes-min 3 \
  --nodes-max 10 \
  --managed

# Deploy entropyDB
kubectl apply -f https://entropydb.io/manifests/aws-eks.yaml

# Or use Terraform
terraform init
terraform plan -var-file=aws.tfvars
terraform apply -var-file=aws.tfvars

Azure Deployment

# Using Azure AKS
az aks create \
  --resource-group entropydb-rg \
  --name entropydb-cluster \
  --node-count 3 \
  --node-vm-size Standard_D4s_v3 \
  --enable-managed-identity \
  --generate-ssh-keys

az aks get-credentials \
  --resource-group entropydb-rg \
  --name entropydb-cluster

# Deploy entropyDB
kubectl apply -f https://entropydb.io/manifests/azure-aks.yaml

Google Cloud Deployment

# Using GKE
gcloud container clusters create entropydb-cluster \
  --zone us-central1-a \
  --num-nodes 3 \
  --machine-type n2-standard-4 \
  --enable-autoscaling \
  --min-nodes 3 \
  --max-nodes 10

gcloud container clusters get-credentials entropydb-cluster \
  --zone us-central1-a

# Deploy entropyDB
kubectl apply -f https://entropydb.io/manifests/gcp-gke.yaml

Bare Metal Deployment

System Requirements

Minimum Requirements:

  • • CPU: 8 cores (16 recommended)
  • • RAM: 16GB (32GB+ recommended)
  • • Storage: 100GB SSD (NVMe recommended)
  • • Network: 1Gbps (10Gbps for clusters)
  • • OS: Linux (Ubuntu 20.04+, RHEL 8+, or similar)

Installation

# Download and install
curl -fsSL https://entropydb.io/install.sh | sudo bash

# Or manual installation
wget https://entropydb.io/releases/entropydb-1.0.0-linux-x64.tar.gz
tar -xzf entropydb-1.0.0-linux-x64.tar.gz
sudo mv entropydb /usr/local/bin/
sudo mkdir -p /var/lib/entropydb
sudo mkdir -p /etc/entropydb

# Create configuration
sudo cat > /etc/entropydb/entropydb.conf << EOF
data_directory = '/var/lib/entropydb'
listen_addresses = '*'
port = 5432
max_connections = 1000
shared_buffers = 8GB
effective_cache_size = 24GB
maintenance_work_mem = 2GB
wal_buffers = 16MB
max_wal_size = 4GB
min_wal_size = 1GB
EOF

# Create systemd service
sudo cat > /etc/systemd/system/entropydb.service << EOF
[Unit]
Description=entropyDB Database Server
After=network.target

[Service]
Type=notify
User=entropydb
ExecStart=/usr/local/bin/entropydb -c /etc/entropydb/entropydb.conf
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target
EOF

# Start service
sudo systemctl daemon-reload
sudo systemctl enable entropydb
sudo systemctl start entropydb
sudo systemctl status entropydb

Cluster Setup

# Node 1 configuration
sudo cat > /etc/entropydb/entropydb.conf << EOF
node_id = 1
cluster_nodes = 'node1.example.com,node2.example.com,node3.example.com'
replication_factor = 3
data_directory = '/var/lib/entropydb'
listen_addresses = '*'
port = 5432
EOF

# Node 2 configuration
sudo cat > /etc/entropydb/entropydb.conf << EOF
node_id = 2
cluster_nodes = 'node1.example.com,node2.example.com,node3.example.com'
replication_factor = 3
data_directory = '/var/lib/entropydb'
listen_addresses = '*'
port = 5432
EOF

# Node 3 configuration
sudo cat > /etc/entropydb/entropydb.conf << EOF
node_id = 3
cluster_nodes = 'node1.example.com,node2.example.com,node3.example.com'
replication_factor = 3
data_directory = '/var/lib/entropydb'
listen_addresses = '*'
port = 5432
EOF

# Initialize cluster (run on node 1)
entropydb-admin cluster init

# Join nodes (run on node 2 and 3)
entropydb-admin cluster join node1.example.com:5432

# Verify cluster status
entropydb-admin cluster status

Multi-Region Deployment

Deploy entropyDB across multiple geographic regions for global low-latency access:

# Region 1: US-West
cluster_name = 'entropydb-global'
region = 'us-west-2'
availability_zones = ['us-west-2a', 'us-west-2b', 'us-west-2c']
replication_mode = 'async'
regions = ['us-west-2', 'eu-central-1', 'ap-southeast-1']

# Region 2: EU-Central
cluster_name = 'entropydb-global'
region = 'eu-central-1'
availability_zones = ['eu-central-1a', 'eu-central-1b', 'eu-central-1c']
replication_mode = 'async'
regions = ['us-west-2', 'eu-central-1', 'ap-southeast-1']

# Region 3: Asia-Pacific
cluster_name = 'entropydb-global'
region = 'ap-southeast-1'
availability_zones = ['ap-southeast-1a', 'ap-southeast-1b', 'ap-southeast-1c']
replication_mode = 'async'
regions = ['us-west-2', 'eu-central-1', 'ap-southeast-1']

# Enable geo-replication
ALTER DATABASE mydb SET geo_replication = 'enabled';
ALTER TABLE users SET locality = REGIONAL BY ROW;

# Query local data
SELECT * FROM users WHERE region = current_region();

# Check replication lag
SELECT * FROM entropy_replication_status;

Latency-Based Routing

# Configure DNS-based routing
resource "aws_route53_record" "entropydb" {
  zone_id = aws_route53_zone.main.zone_id
  name    = "db.example.com"
  type    = "A"
  
  latency_routing_policy {
    region = "us-west-2"
  }
  
  alias {
    name                   = aws_lb.us_west.dns_name
    zone_id                = aws_lb.us_west.zone_id
    evaluate_target_health = true
  }
}

# Client-side connection
const client = new EntropyClient({
  hosts: [
    'us-west.db.example.com',
    'eu-central.db.example.com',
    'ap-southeast.db.example.com'
  ],
  routing: 'latency-aware',
  failover: 'automatic'
});

Best Practices

High Availability

  • • Deploy at least 3 nodes per region
  • • Use multiple availability zones
  • • Configure automatic failover
  • • Monitor replication lag

Performance

  • • Use SSD/NVMe storage
  • • Configure adequate memory
  • • Enable connection pooling
  • • Optimize network bandwidth

Security

  • • Enable TLS/SSL encryption
  • • Use strong passwords
  • • Configure firewall rules
  • • Regular security updates

Monitoring

  • • Set up Prometheus/Grafana
  • • Configure alerting
  • • Monitor resource usage
  • • Track query performance

Next Steps

This guide is being revised. Some examples may use syntax or features EntropyDB does not support. For checked instructions, see Installation, Quick Start and the docs/ folder in the repository.