Skip to content

Production Operations & Orchestration

VaagaGraph Deployment Guide

Architected for reliable deployment in resource-efficient container environments, Kubernetes (EKS) pods, and serverless runtimes.

1. Kubernetes EKS (Predictable Footprint Sharding)

VaagaGraph is optimized to operate predictably within modest pod limits (e.g. 1GB memory allocations). By coordinating consistent hash sharding, tiered in-memory caching, and an active 75% resource governor (reserving 256MB for runtime garbage collection), it maintains stable operational margins during high-concurrency graph traversals.

# Kubernetes StatefulSet for VaagaGraph Clustered Pods
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: vaaga-graph
spec:
  serviceName: "vaaga-graph-headless"
  replicas: 3
  selector:
    matchLabels:
      app: vaaga-graph
  template:
    metadata:
      labels:
        app: vaaga-graph
    spec:
      containers:
        - name: vaaga-graph
          image: vaagatech/vaaga-graph-server:latest
          env:
            # Enforce 768MB heap to leave 256MB headroom under 1Gi container limit
            - name: NODE_OPTIONS
              value: "--max-old-space-size=768"
            - name: PORT
              value: "4000"
            - name: SEED_NODES
              value: "vaaga-graph-0.vaaga-graph-headless:4000,vaaga-graph-1.vaaga-graph-headless:4000,vaaga-graph-2.vaaga-graph-headless:4000"
          ports:
            - containerPort: 4000
              name: http
          resources:
            limits:
              memory: "1Gi"
              cpu: "1000m"
            requests:
              memory: "512Mi"
              cpu: "250m"
          livenessProbe:
            httpGet:
              path: /healthz
              port: 4000
          readinessProbe:
            httpGet:
              path: /readyz
              port: 4000

2. Client Application Connection (Node.js SDK)

The client SDK connects directly to cluster endpoints, auto-discovers peer nodes, maintains a client-side Consistent Hash Ring for shard-aware direct routing, and executes Dynamic Match Threshold queries:

import { VaagaGraphClient } from '@vaagatech/vaaga-graph-sdk';

const client = new VaagaGraphClient({
  endpoints: ['http://vaaga-graph.default.svc.cluster.local:4000'],
  requestTimeoutMs: 5000,
});

await client.connect();

// 1. Resilient Batch Ingestion (Corrupted items isolated to dead-letter quarantine)
const batch = await client.upsertNodesSafe([
  { id: 'usr-1', labels: ['Engineer'], props: { role: 'Architect', city: 'Chennai' } },
  { id: 'usr-2', labels: ['Engineer'], props: { role: 'Developer', city: 'Bengaluru' } },
]);
console.log(`Ingested: ${batch.insertedCount}, Quarantined: ${batch.quarantinedCount}`);

// 2. Execute Dynamic Match Threshold Query (pass any threshold: 25, 50, 75, 90...)
const { results, latencyMs } = await client.query().match({
  label: 'Engineer',
  threshold: 50, // Configurable threshold: e.g. 50%
  props: { role: 'Architect', city: 'Chennai' },
});

3. Serverless AWS Lambda Deployment

For event-driven APIs or unpredictable workloads, VaagaGraph runs serverless-native inside AWS Lambda with S3 storage, yielding $0.00 idle monthly cost:

import { VaagaiGraph, LambdaS3Storage } from '@vaagatech/vaaga-graph';
import { S3Client } from '@aws-sdk/client-s3';

const s3Client = new S3Client({ region: process.env.AWS_REGION });
let graphInstance: VaagaiGraph | null = null;

async function getGraph(): Promise<VaagaiGraph> {
  if (!graphInstance) {
    graphInstance = await VaagaiGraph.open({
      storage: new LambdaS3Storage({
        s3Client,
        bucket: process.env.GRAPH_S3_BUCKET!,
        prefix: 'graphs/production',
        localTmpDir: '/tmp/graph-cache',
      }),
      snapshotKey: 'snapshot.json',
      persistenceMode: 'wal',
    });
  }
  return graphInstance;
}

4. Management Studio UI

Launch the web management dashboard locally or in container:

npm run start:studio
# Open http://localhost:4001 in your browser