-
Notifications
You must be signed in to change notification settings - Fork 1
Integration Guide
How to integrate ThemisDB into your application, CI/CD pipeline, or existing system.
Version: 1.9.0-beta | Updated: 2026-05
- Quick Integration Overview
- REST API Integration
- Client SDKs
- Docker / Docker Compose
- Kubernetes / Helm
- Authentication Setup
- Python Client Example
- JavaScript / Node.js Client Example
- gRPC Integration
- Environment Variables
- Health Checks & Monitoring
- Common Integration Patterns
ThemisDB exposes three integration points:
| Interface | Port | Best For |
|---|---|---|
| REST / HTTP | 8080 | Web apps, scripting, any language |
| gRPC / Binary | 18765 | High-throughput services, polyglot |
| GraphQL | 8080 (/graphql) |
Flexible front-end queries |
Minimum steps to integrate:
# 1. Start ThemisDB
docker run -d --name themisdb -p 8080:8080 themisdb/themisdb:latest
# 2. Verify connectivity
curl http://localhost:8080/health
# Expected: {"status":"ok","version":"1.9.0-beta"}
# 3. Write your first record
curl -X PUT http://localhost:8080/entities/myapp:record-1 \
-H "Content-Type: application/json" \
-d '{"blob":"{\"hello\":\"world\"}"}'
# 4. Read it back
curl http://localhost:8080/entities/myapp:record-1The REST API follows a consistent pattern across all resource types.
http://<host>:8080
| Method | Path | Description |
|---|---|---|
GET |
/health |
Health check |
GET |
/info |
Version & feature info |
PUT |
/entities/{collection}:{id} |
Create or update entity |
GET |
/entities/{collection}:{id} |
Read entity |
DELETE |
/entities/{collection}:{id} |
Delete entity |
POST |
/entities/batch |
Batch write |
POST |
/query |
Query with predicates |
POST |
/aql |
AQL query |
POST |
/index/create |
Create secondary index |
POST |
/vector/search |
kNN vector search |
POST |
/graph/traverse |
Graph traversal |
POST |
/transaction/begin |
Start transaction |
POST |
/transaction/commit |
Commit transaction |
POST |
/transaction/rollback |
Roll back transaction |
See api/REST_API_REFERENCE.md for the full reference.
Native client libraries are available for several languages:
| Language | Location | Status |
|---|---|---|
| Python | clients/python/ |
Available |
| JavaScript/Node.js | clients/ |
Available |
| Go | clients/ |
Available |
| Java | clients/ |
Available |
| C++ | Native (included in ThemisDB) | Available |
See clients/README.md for installation instructions per language.
docker run -d \
--name themisdb \
-p 8080:8080 \
-p 18765:18765 \
-p 4318:4318 \
-v themis_data:/data \
-e THEMIS_LOG_LEVEL=info \
themisdb/themisdb:latest# docker-compose.yml
version: "3.9"
services:
themisdb:
image: themisdb/themisdb:latest
container_name: themisdb
restart: unless-stopped
ports:
- "8080:8080"
- "18765:18765"
- "4318:4318"
volumes:
- themis_data:/data
- ./config.yaml:/etc/themis/config.yaml:ro
environment:
- THEMIS_CONFIG=/etc/themis/config.yaml
- THEMIS_LOG_LEVEL=info
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 5s
retries: 3
volumes:
themis_data:docker compose up -d
docker compose logs -f themisdbA Helm chart is available under helm/:
# Install with Helm
helm install themisdb ./helm/themisdb \
--namespace themisdb \
--create-namespace \
--set persistence.size=50Gi \
--set resources.limits.memory=8Gi
# Check status
kubectl get pods -n themisdb
kubectl logs -n themisdb deployment/themisdbRefer to helm/themisdb/values.yaml for all configuration options.
# 1. Obtain a token
curl -X POST http://localhost:8080/auth/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"changeme"}'
# Expected: {"token":"<jwt>","expires_in":3600}
# 2. Use the token
curl http://localhost:8080/entities/users:alice \
-H "Authorization: Bearer <jwt>"curl http://localhost:8080/entities/users:alice \
-H "X-Api-Key: your-api-key-here"For full auth configuration including RBAC, LDAP, and mTLS, see:
- guides/ad_ldap_integration_guide.md
- de/guides/guides_rbac.md
- security/api_authentication_authorization.md
import requests
BASE_URL = "http://localhost:8080"
HEADERS = {"Content-Type": "application/json"}
class ThemisClient:
def __init__(self, base_url: str, token: str | None = None):
self.base_url = base_url
self.session = requests.Session()
self.session.headers.update({"Content-Type": "application/json"})
if token:
self.session.headers["Authorization"] = f"Bearer {token}"
def put(self, collection: str, entity_id: str, data: dict) -> dict:
import json
resp = self.session.put(
f"{self.base_url}/entities/{collection}:{entity_id}",
json={"blob": json.dumps(data)},
)
resp.raise_for_status()
return resp.json()
def get(self, collection: str, entity_id: str) -> dict:
resp = self.session.get(
f"{self.base_url}/entities/{collection}:{entity_id}"
)
resp.raise_for_status()
return resp.json()
def delete(self, collection: str, entity_id: str) -> dict:
resp = self.session.delete(
f"{self.base_url}/entities/{collection}:{entity_id}"
)
resp.raise_for_status()
return resp.json()
def query(self, table: str, predicates: list, limit: int = 100) -> dict:
resp = self.session.post(
f"{self.base_url}/query",
json={"table": table, "predicates": predicates,
"limit": limit, "return": "entities"},
)
resp.raise_for_status()
return resp.json()
def vector_search(self, collection: str, vector: list, k: int = 10) -> dict:
resp = self.session.post(
f"{self.base_url}/vector/search",
json={"collection": collection, "vector": vector,
"k": k, "metric": "cosine"},
)
resp.raise_for_status()
return resp.json()
# --- Usage ---
client = ThemisClient("http://localhost:8080")
# Create
client.put("users", "alice", {"name": "Alice", "age": 30, "city": "Berlin"})
# Read
record = client.get("users", "alice")
print(record)
# Query
results = client.query("users", [{"column": "city", "value": "Berlin"}])
print(results)// themis-client.js
const BASE_URL = process.env.THEMIS_URL ?? "http://localhost:8080";
async function request(method, path, body = undefined) {
const res = await fetch(`${BASE_URL}${path}`, {
method,
headers: { "Content-Type": "application/json" },
body: body !== undefined ? JSON.stringify(body) : undefined,
});
if (!res.ok) throw new Error(`ThemisDB ${method} ${path}: ${res.status}`);
return res.json();
}
const themis = {
put: (col, id, data) =>
request("PUT", `/entities/${col}:${id}`, { blob: JSON.stringify(data) }),
get: (col, id) =>
request("GET", `/entities/${col}:${id}`),
delete: (col, id) =>
request("DELETE", `/entities/${col}:${id}`),
query: (table, predicates, limit = 100) =>
request("POST", "/query", { table, predicates, limit, return: "entities" }),
vectorSearch: (collection, vector, k = 10) =>
request("POST", "/vector/search", { collection, vector, k, metric: "cosine" }),
};
// --- Usage ---
(async () => {
await themis.put("products", "widget-1", { name: "Widget", price: 9.99 });
const rec = await themis.get("products", "widget-1");
console.log(rec);
})();# Protocol buffer definitions
ls proto/
# Generate client stubs (example for Python)
python -m grpc_tools.protoc \
-I proto/ \
--python_out=./client \
--grpc_python_out=./client \
proto/themis.proto
# Connect on port 18765
grpcurl -plaintext localhost:18765 listSee proto/ for all .proto files and docs/de/rpc_grpc/ for gRPC-specific docs.
| Variable | Default | Description |
|---|---|---|
THEMIS_CONFIG |
config.yaml |
Config file path |
THEMIS_LOG_LEVEL |
info |
Log level (debug/info/warn/error) |
THEMIS_DATA_DIR |
./data |
Storage directory |
THEMIS_PORT |
8080 |
HTTP port |
THEMIS_GRPC_PORT |
18765 |
gRPC port |
THEMIS_ALLOW_STUB_HSM |
false |
Allow development stub HSM (not for production) |
# Liveness
curl http://localhost:8080/health
# Expected: {"status":"ok","version":"1.9.0-beta"}
# Readiness (storage ready)
curl http://localhost:8080/ready
# Prometheus metrics
curl http://localhost:4318/metrics
# Key metrics
# themis_requests_total β total request count by endpoint
# themis_request_duration_ms β request latency histogram
# themis_storage_bytes_used β storage utilisation
# themis_vector_search_duration β vector search latencyGrafana dashboard is available at grafana/.
When making many concurrent requests from the same service, reuse HTTP connections:
# Python β use a Session with pool_maxsize
session = requests.Session()
adapter = requests.adapters.HTTPAdapter(pool_maxsize=20)
session.mount("http://", adapter)Use transactions when multiple writes must succeed or fail together:
TX=$(curl -s -X POST $BASE/transaction/begin | jq -r .tx_id)
curl -X PUT $BASE/entities/accounts:alice -H "X-Transaction-ID: $TX" \
-d '{"blob":"{\"balance\":900}"}'
curl -X PUT $BASE/entities/accounts:bob -H "X-Transaction-ID: $TX" \
-d '{"blob":"{\"balance\":1100}"}'
curl -X POST $BASE/transaction/commit -d "{\"tx_id\":\"$TX\"}"import time, requests
def with_retry(fn, max_attempts=3, base_delay=0.5):
for attempt in range(max_attempts):
try:
return fn()
except requests.HTTPError as e:
if e.response.status_code < 500 or attempt == max_attempts - 1:
raise
time.sleep(base_delay * 2 ** attempt)Use batch operations for large data loads:
BATCH_SIZE = 500
def bulk_load(client_session, records):
for i in range(0, len(records), BATCH_SIZE):
batch = records[i:i + BATCH_SIZE]
operations = [
{"op": "put", "id": f"data:{r['id']}", "blob": json.dumps(r)}
for r in batch
]
client_session.post(f"{BASE_URL}/entities/batch",
json={"operations": operations}).raise_for_status()| Document | Description |
|---|---|
| [[QUICK_REFERENCE.md | Quick-Reference]] |
| api/REST_API_REFERENCE.md | Full REST endpoint reference |
| api/AUTHENTICATION_AND_RATE_LIMITING.md | Auth & rate limiting |
| de/guides/guides_deployment.md | Deployment guide |
| security/HSM_PRODUCTION_SETUP.md | Production security |
| [[FAQ.md | FAQ]] |
ThemisDB 1.9.0-beta Β· Home Β· Module-Index Β· GitHub Β· Issues
ThemisDB 1.9.0-beta Β· Home Β· Wiki-Index Β· Module-Index Β· FAQ Β· Quick-Reference Β· GitHub Β· Issues Β· Discussions Β· License
- Batch Operations
- Best Practices
- CRUD Tutorial
- Custom Document Ingestion
- Getting Started Tutorial
- Interactive Examples
- Schema Design
- Video Tutorials
- AQL Reference
- AQL Examples
- AQL Overview
- AQL Feature Roadmap
- AQL Geospatial Guide
- AQL LLM Migration Guide
- AQL API
- AQL Grammar (EBNF)
- AQL Root Overview
- AQL Examples (root)
- API Reference
- API Module README
- OpenAPI Overview
- Client SDK Overview
- SDK Overview
- Operations
- Operations Overview
- Operations Runbook
- Operations Handbook
- ThemisCtl Admin Guide
- Pipeline E2E SOPs
- Deploy Overview
- Docker Overview
- Docker Hub README
- Helm Overview
- Packaging Overview
- Operator Overview
- Security Policy
- Production Hardening Checklist
- Security Hardening Guide
- Encryption Key Management
- Access Control Framework
- Zero Trust Policy
- API Authentication & Authorization
- HSM Production Setup
- PKCS11 Integration
- DSGVO / SOC2 Checklist
- Access Model Runbooks
- Access Model Dashboard
- Maturity Automation Runbook
- Access Review Automation
- Access Model Dashboard
- Access Model Runbooks
- Rights Revocation
- Dr Checklists
- Dr Testing
- Incident Response Playbook
- Incident Response Testing
- GPU Oom Recovery
- Grammar Debugging
- Metrics Scrape Troubleshooting
- Model Swap Procedure
- Quota Tuning
- Subagent Deployment
- Logging Configuration
- Content Model
- Crypto & Keys
- Feature Flags Reference
- Modular Architecture Roadmap
- Modularization Guide
- Module Architecture Index
- PostgreSQL Wire Protocol
- Query Scheduling
- Raft Consensus Design
- Resource Pooling
- Source Directory Guide
- Unified Access Model
- E1 001 Layered Retrieval Design
- E1 002 Ann Abstraction Strategy
- E1 003 Tensor Summary Types
- E1 004 Lora Package Distinction
- E1 005 Model Switch Compatibility
- E1 006 Federated Tensor Summaries
- E2 001 Evaluation Framework Design
- E2 002 Hardware Profile Strategy
- E2 003 Query Planner Routing Model
- E2 004 Approximation Governance Rules
- E2 005 Cross Layer Fallback Confidence Policy
- E3 001 Distributed Tensor Design
- E3 002 Manifest Coordination Strategy
- E3 003 Recovery And Erasure Choice
- E3 004 Tensor Fabric Infrastructure
- Contributing
- Contributing (root)
- Code of Conduct
- Support
- Maintainers
- CTest Guide
- Build Quick Reference
- Developer Wiki Index
- Build / Test / CI
- Module Index
- Branching Strategy
- Disabled Stub Policy
- Docs PR Policy
- GA Promotion Sign Off
- Github Milestones Setup
- Maturity Claim Verification Checklist
- Maturity Evidence Registry
- Merge Gate Bot Config
- Merge Gate Status Live
- Phase 1 Closure Report
- Phase Closure Policy
- Phase Dependency Graph
- Phase3 Enforcement Runbook
- Plugin Submodule Rollback
- PR Version Targeting
- PR Version Targeting Backfill
- Production Ready 2026 Delivery Plan
- Query Module Status
- Readme
- Release Promotion Gate Policy
- Release Validation Checklist
- Security Module 5671 Evidence Summary
- Sharding P6 Residual Risk Acceptance
- Sourcecode Compliance Governance
- Updates Development Status Sign Off
- Wave C Implementation Complete
- Blob Storage
- Cuda
- Ethics Ai
- Exporters
- Huggingface
- Image Analysis
- Importers
- RPC
- Scraper
- Themisdb Ai Watermark Detector
- User Storage Encrypted
- Chimera Architecture
- Chimera Future
- Chimera Readme
- Chimera Roadmap
- Covina Fastapi Ingestion Architecture
- Covina Fastapi Ingestion Future
- Covina Fastapi Ingestion Roadmap
- Vcc Base Architecture
- Vcc Base Future
- Vcc Base Roadmap
- Vcc Clara Ingestion Architecture
- Vcc Clara Ingestion Future
- Vcc Clara Ingestion Roadmap
- Vcc Veritas Architecture
- Vcc Veritas Future
- Vcc Veritas Roadmap
- 01 Hello World
- 02 Todo App
- 03 Contact Manager
- 04 Inventory System
- 05 Time Series Monitor
- 06 Graph Social Network
- 07 Vector Search Documents
- 08 Dms Erp System
- 09 Iot Sensor Network
- 10 Drone Image Analysis
- 11 Blog Wiki
- 12 Expense Tracker
- 13 Recipe Manager
- 14 Ecommerce Catalog
- 15 Event Management
- 16 Kanban Board
- 17 Crm
- 18 Realtime Chat
- 19 Recommendation Engine
- 20 Smart Home
- 21 Coding Platform
- 22 AQL Diagram Tool
- 23 Traveling Salesman
- 24 Moral Philosophy Debates
- API Versioning
- Distributed Sharding
- Feedback Plugins
- Geo
- Gnn
- Image Analysis
- Legal Lora Training
- LLM
- Lora Sync
- Migration
- Nlp
- Performance
- Railway
- Replication
- Rope Visualization
- Sample Product Config
- Security
- Client SDK Overview
- Quickstart
- Sdk Enhancements
- Sdk Implementation Summary
- Test Suite Readme
- Go
- Java
- Javascript
- Php
- Python
- Ruby
- Rust
- Typescript
- 01 Grundlegende Operationen
- 02 AQL Queries
- 03 Graph Daten
- 04 Multimodell Anwendung
- 01 Quickstart Guide
- 02 AQL Referenz Kurzuebersicht
- 03 Datenmodellierung Guide
- 04 Uebungsaufgaben
- 05 Best Practices Guide
- Training Documents
- Training Overview
- 01 Einfuehrung Und Uebersicht
- 02 Datenmodelle Und Architektur
- 03 AQL Abfragesprache
- 04 Installation Und Setup
- 05 Anwendungsbeispiele
- Training Presentations
- Dependencies Readme
- Processmonitor Readme
- Themis.admintools.shared Readme
- Themis.aqlquerybuilder Readme
- Themis.aqlquerybuilder Roadmap
- Themis.auditlogviewer Readme
- Themis.auditlogviewer Roadmap
- Themis.classificationdashboard Readme
- Themis.classificationdashboard Roadmap
- Themis.compliancereports Readme
- Themis.compliancereports Roadmap
- Themis.gisviewer.controlpanel Readme
- Themis.gisviewer.controlpanel Roadmap
- Themis.impactanalysisviewer Readme
- Themis.impactanalysisviewer Roadmap
- Themis.ingestiontool Readme
- Themis.ingestiontool Roadmap
- Themis.keyrotationdashboard Readme
- Themis.keyrotationdashboard Roadmap
- Themis.piimanager Readme
- Themis.piimanager Roadmap
- Themis.retentionmanager Readme
- Themis.retentionmanager Roadmap
- Themis.sagaverifier Readme
- Themis.sagaverifier Roadmap
- Themis.usbadmintool Readme
- Themis.usbadmintool Roadmap
- CI Readme
- CI Roadmap
- Compiler Diagnostics Readme
- Compiler Diagnostics Roadmap
- Completion Readme
- Copilot Ollama Router Readme
- Copilot Ollama Router Roadmap
- Gnn Readme
- Gnn Roadmap
- Rope Visualizer Readme
- Rope Visualizer Roadmap
- Tco Calculator Readme
- Tco Calculator Roadmap
- Tests Readme
- Tests Roadmap
- Themis Config Wx Readme
- Themis Docs Builder Readme
- Wikipedia Ingestion Readme