Skip to main content
Version: Next

Installation

Complete installation guide for SochDB across different platforms and use cases.

Python SDK​

pip install sochdb

Pre-built binaries are available for Linux (x86_64), macOS (Apple Silicon), and Windows (x86_64).

Verify Installation​

from sochdb import Database

db = Database.open("./test_db")
db.put(b"test", b"hello")
value = db.get(b"test")
print(f"SochDB installed! Value: {value.decode()}")
db.close()

Node.js / TypeScript SDK​

npm install @sochdb/sochdb

Verify Installation​

import { SochDatabase } from '@sochdb/sochdb';

const db = new SochDatabase('./test_db');
await db.put('test', 'hello');
const value = await db.get('test');
console.log(`SochDB installed! Value: ${value}`);
await db.close();

Go SDK​

go get github.com/sochdb/sochdb-go@v0.3.1

Verify Installation​

package main

import (
"fmt"
sochdb "github.com/sochdb/sochdb-go"
)

func main() {
db, _ := sochdb.Open("./test_db")
defer db.Close()

db.Put([]byte("test"), []byte("hello"))
value, _ := db.Get([]byte("test"))
fmt.Printf("SochDB installed! Value: %s\n", value)
}

Rust Crate​

Add to your Cargo.toml:

[dependencies]
sochdb = "0.2"

Verify Installation​

use sochdb::Database;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let db = Database::open("./test_db")?;

db.put(b"test", b"hello")?;
if let Some(value) = db.get(b"test")? {
println!("SochDB installed! Value: {}", String::from_utf8_lossy(&value));
}
Ok(())
}

Build from Source​

Prerequisites​

RequirementMinimum Version
Rust1.75+ (2024 edition)
GitAny recent
C CompilerGCC 9+ or Clang 11+

Clone and Build​

# Clone the repository
git clone https://github.com/sochdb/sochdb
cd sochdb

# Build release binaries
cargo build --release

# Run tests
cargo test --release

# Install CLI (optional)
cargo install --path sochdb-cli

Build Python Bindings from Source​

cd sochdb-python-sdk

# Create virtual environment
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows

# Install build dependencies
pip install maturin

# Build and install
maturin develop --release

Platform-Specific Notes​

macOS​

On Apple Silicon Macs, ensure you're using a native ARM64 Python:

# Check architecture
python -c "import platform; print(platform.machine())"
# Should output: arm64

Linux​

For best performance, ensure your kernel supports io_uring:

# Check kernel version (5.1+ recommended)
uname -r

Windows​

Use PowerShell or Windows Terminal for the best experience:

# Install via pip
pip install sochdb

Verifying Your Installation​

Run the diagnostic script to verify everything is working:

from sochdb import Database, VectorIndex
import numpy as np

# Test basic operations
db = Database(":memory:")

with db.transaction() as txn:
txn.put("test/key", b"value")

value = db.get("test/key")
assert value == b"value", "Basic KV operations failed"
print("āœ“ Key-value operations working")

# Test vector index (if available)
try:
index = VectorIndex(dimension=128)
vectors = np.random.rand(10, 128).astype(np.float32)
index.insert_batch(vectors, list(range(10)))

query = np.random.rand(128).astype(np.float32)
results = index.search(query, k=5)
print(f"āœ“ Vector search working (found {len(results)} results)")
except Exception as e:
print(f"⚠ Vector search not available: {e}")

print("\nšŸŽ‰ SochDB is ready to use!")

Next Steps​