-
Notifications
You must be signed in to change notification settings - Fork 1
CLIENT_IMPLEMENTATION_ROADMAP
Stand: 15. Dezember 2025
Version: 1.0.0
Status: Planning
Kategorie: Roadmap
Dieses Dokument beschreibt die Client-seitigen Implementierungs-Anforderungen für die neuen Auto-Batching Features in ThemisDB:
- TSAutoBuffer (Time Series)
- VectorAutoBuffer (Vector Index)
- Compressed WAL Shipping (Replication)
POST /ts/put/buffered
- Speichert Time-Series DataPoint im Auto-Buffer
- Automatische Gorilla-Kompression bei Flush
- Niedrige Latenz (<0.1ms response)
GET /ts/buffer/stats
- Gibt Buffer-Statistiken zurück
- Metrics: buffered points, flush count, compression ratio
POST /ts/buffer/flush
- Manueller Flush des Buffers
- Admin-Operation
POST /ts/put/buffered
// Request
{
"metric": "cpu_usage",
"entity": "server01",
"timestamp_ms": 1702645200000,
"value": 75.5,
"tags": {
"datacenter": "eu-west-1",
"environment": "production"
}
}
// Response (Success)
{
"success": true,
"buffered": true,
"buffer_size": 127
}
// Response (Error)
{
"success": false,
"error": "Buffer overflow",
"buffer_size": 1000
}GET /ts/buffer/stats
// Response
{
"points_buffered": 15234,
"points_flushed": 98765,
"flush_count": 99,
"auto_flush_count": 95,
"manual_flush_count": 4,
"current_buffer_size": 234,
"current_buffer_memory": 47800,
"avg_compression_ratio": 15.2,
"last_flush_time": "2025-12-15T12:30:00Z"
}class ThemisTimeSeriesClient:
def put_buffered(self, metric, entity, timestamp_ms, value, tags=None):
"""Send data point to buffered endpoint"""
pass
def get_buffer_stats(self):
"""Get buffer statistics"""
pass
def flush_buffer(self):
"""Manually flush buffer (admin)"""
passinterface DataPoint {
metric: string;
entity: string;
timestamp_ms: number;
value: number;
tags?: Record<string, string>;
}
interface BufferStats {
points_buffered: number;
points_flushed: number;
current_buffer_size: number;
avg_compression_ratio: number;
}
class ThemisTimeSeriesClient {
async putBuffered(point: DataPoint): Promise<void>;
async getBufferStats(): Promise<BufferStats>;
async flushBuffer(): Promise<void>;
}type DataPoint struct {
Metric string `json:"metric"`
Entity string `json:"entity"`
TimestampMs int64 `json:"timestamp_ms"`
Value float64 `json:"value"`
Tags map[string]string `json:"tags,omitempty"`
}
type TimeSeriesClient struct {}
func (c *TimeSeriesClient) PutBuffered(ctx context.Context, point DataPoint) error
func (c *TimeSeriesClient) GetBufferStats(ctx context.Context) (*BufferStats, error)
func (c *TimeSeriesClient) FlushBuffer(ctx context.Context) error0x70 - TS_PUT_BUFFERED (TimeSeries Buffered Put)
0x71 - TS_BUFFER_STATS (Get Buffer Stats)
0x72 - TS_BUFFER_FLUSH (Manual Flush)
Header: [OpCode: 1 byte][Flags: 1 byte][Length: 4 bytes]
Payload:
- metric_len: 2 bytes
- metric: N bytes (UTF-8)
- entity_len: 2 bytes
- entity: N bytes (UTF-8)
- timestamp_ms: 8 bytes (int64)
- value: 8 bytes (double)
- tags_len: 2 bytes
- tags: N bytes (JSON)
POST /vectors/add/buffered
- Speichert Vector Entity im Auto-Buffer
- Automatisches Batch-HNSW-Update
POST /vectors/update/buffered
- Aktualisiert Vector Entity (buffered)
DELETE /vectors/remove/buffered
- Entfernt Vector Entity (buffered)
GET /vectors/buffer/stats
- Gibt Buffer-Statistiken zurück
POST /vectors/buffer/flush
- Manueller Flush des Buffers
POST /vectors/add/buffered
// Request
{
"pk": "doc_12345",
"vector": [0.123, 0.456, ..., 0.789], // 768 dimensions
"metadata": {
"title": "Sample Document",
"category": "technology"
}
}
// Response
{
"success": true,
"buffered": true,
"buffer_size": 342
}GET /vectors/buffer/stats
// Response
{
"vectors_buffered": 5234,
"vectors_flushed": 48765,
"flush_count": 49,
"current_buffer_size": 342,
"current_buffer_memory": 1048576,
"compression_type": "none",
"last_flush_time": "2025-12-15T12:30:00Z"
}class ThemisVectorClient:
def add_buffered(self, pk: str, vector: List[float], metadata: dict = None):
"""Add vector to buffer"""
pass
def update_buffered(self, pk: str, vector: List[float], metadata: dict = None):
"""Update vector in buffer"""
pass
def remove_buffered(self, pk: str):
"""Remove vector (buffered)"""
pass
def get_buffer_stats(self):
"""Get buffer statistics"""
passinterface VectorEntity {
pk: string;
vector: number[];
metadata?: Record<string, any>;
}
class ThemisVectorClient {
async addBuffered(entity: VectorEntity): Promise<void>;
async updateBuffered(entity: VectorEntity): Promise<void>;
async removeBuffered(pk: string): Promise<void>;
async getBufferStats(): Promise<BufferStats>;
}0x80 - VECTOR_ADD_BUFFERED
0x81 - VECTOR_UPDATE_BUFFERED
0x82 - VECTOR_REMOVE_BUFFERED
0x83 - VECTOR_BUFFER_STATS
0x84 - VECTOR_BUFFER_FLUSH
POST /api/v1/wal/apply
- Empfängt komprimierte WAL-Batches
- Header: Content-Encoding: zstd
- Automatische Dekompression
GET /api/v1/replication/stats
- Gibt Replikations-Statistiken inkl. Compression Ratio zurück
POST /api/v1/replication/config
- Konfiguriert Compression-Level
POST /api/v1/wal/apply (mit Kompression)
// Request Headers
Content-Type: application/json
Content-Encoding: zstd
X-Primary-ID: primary-1
// Request Body (komprimiert)
{
"primary_id": "primary-1",
"compression": "zstd",
"entries_compressed": <binary_data_base64>
}
// Response
{
"success": true,
"entries_applied": 500,
"compression_ratio": 5.2,
"decompression_time_ms": 12
}GET /api/v1/replication/stats
// Response
{
"replicas": [
{
"replica_id": "replica-1",
"endpoint": "https://replica1.example.com:8443",
"last_confirmed_lsn": "0000000100000042",
"lag_bytes": 0,
"lag_ms": 150,
"is_healthy": true
}
],
"stats": {
"total_entries_shipped": 1000000,
"total_bytes_shipped": 5000000000,
"total_bytes_uncompressed": 25000000000,
"avg_compression_ratio": 5.0,
"total_batches": 10000,
"failed_ships": 5
}
}class ThemisReplicationClient:
def add_replica(self, replica_id: str, endpoint: str):
"""Add replication replica"""
pass
def get_replication_stats(self) -> ReplicationStats:
"""Get replication statistics"""
pass
def configure_compression(self, compression_type: str, level: int):
"""Configure WAL compression"""
passtype WALShipperClient struct {
mtlsClient *MTLSClient
}
func (c *WALShipperClient) ApplyWALBatch(ctx context.Context, batch CompressedWALBatch) error
func (c *WALShipperClient) GetReplicationStats(ctx context.Context) (*ReplicationStats, error)0x90 - WAL_APPLY_COMPRESSED (Apply compressed WAL batch)
0x91 - REPLICATION_STATS (Get replication stats)
0x92 - REPLICATION_CONFIG (Configure compression)
- Test: Buffer size threshold flush
- Test: Time threshold flush
- Test: Memory threshold flush
- Test: Thread-safety (multi-threaded inserts)
- Test: Manual flush
- Test: Buffer overflow handling
Files:
tests/test_ts_auto_buffer.cpp
- Test: Multi-operation buffering (ADD/UPDATE/REMOVE)
- Test: Flush triggers
- Test: Thread-safety
- Test: Buffer statistics
Files:
tests/test_vector_auto_buffer.cpp
- Test: Zstd compression/decompression
- Test: Compression ratio calculation
- Test: Error handling (decompression failure)
- Test: Statistics tracking
Files:
tests/test_compressed_wal_shipping.cpp
- Test:
/ts/put/bufferedendpoint - Test:
/vectors/add/bufferedendpoint - Test: Buffer stats endpoints
- Test: Error responses
Files:
tests/test_http_auto_buffer_integration.cpp
- Test: Complete RAG ingestion pipeline with VectorAutoBuffer
- Test: Time-series streaming with TSAutoBuffer
- Test: Geo-replication with Compressed WAL Shipping
Files:
tests/test_auto_buffer_e2e.cpp
- Benchmark: TSAutoBuffer vs direct insert
- Benchmark: VectorAutoBuffer vs direct insert
- Benchmark: Compressed vs uncompressed WAL shipping
Files:
benchmarks/bench_ts_auto_buffer.cppbenchmarks/bench_vector_auto_buffer.cppbenchmarks/bench_compressed_wal_shipping.cpp
- OpenAPI/Swagger specs für neue Endpoints
- Binary protocol documentation
- Client SDK examples
Files:
openapi/auto_buffer_endpoints.yamldocs/api/AUTO_BUFFER_REST_API.mddocs/api/BINARY_PROTOCOL_EXTENSIONS.md
- Python Client Guide
- JavaScript/TypeScript Client Guide
- Go Client Guide
- Java Client Guide (optional)
Files:
docs/clients/PYTHON_AUTO_BUFFER.mddocs/clients/JAVASCRIPT_AUTO_BUFFER.mddocs/clients/GO_AUTO_BUFFER.md
- Unit tests für alle AutoBuffer-Komponenten
- Basic benchmarks
- HTTP API integration tests
- Python Client SDK updates
- JavaScript/TypeScript Client SDK updates
- Go Client SDK updates
- Wire protocol extensions
- Binary protocol tests
- Client SDK binary protocol support
- API documentation
- Client integration guides
- Example applications
Guaranteed:
- Existing
/ts/putendpoint funktioniert weiterhin - Existing
/vectors/addendpoint funktioniert weiterhin - WAL shipping ohne Kompression funktioniert weiterhin
Neue Features (Opt-in):
-
/ts/put/buffered- Opt-in für Auto-Buffering -
/vectors/add/buffered- Opt-in für Auto-Buffering - Compressed WAL - Opt-in via Config
Schritt 1: Server-Update
# Update ThemisDB Server auf v1.2.0
docker pull themisdb/themisdb:v1.2.0Schritt 2: Client SDK Update
# Python
pip install --upgrade themisdb-client>=1.2.0
# JavaScript
npm install @themisdb/client@^1.2.0
# Go
go get -u github.com/themisdb/go-client@v1.2.0Schritt 3: Code-Anpassungen
# Vorher (direct insert)
client.timeseries.put(metric="cpu", entity="server01", value=75.5)
# Nachher (buffered insert - optional)
client.timeseries.put_buffered(metric="cpu", entity="server01", value=75.5)Neue Metriken:
# TSAutoBuffer
ts_auto_buffer_points_buffered_total
ts_auto_buffer_points_flushed_total
ts_auto_buffer_flush_count_total
ts_auto_buffer_compression_ratio
ts_auto_buffer_current_size
# VectorAutoBuffer
vector_auto_buffer_vectors_buffered_total
vector_auto_buffer_vectors_flushed_total
vector_auto_buffer_current_size
# Compressed WAL Shipping
wal_shipper_bytes_uncompressed_total
wal_shipper_bytes_shipped_total
wal_shipper_compression_ratio
wal_shipper_batches_total
Erforderlich:
- TSAutoBuffer Dashboard
- VectorAutoBuffer Dashboard
- Compressed WAL Shipping Dashboard
Files:
deploy/grafana/dashboards/ts_auto_buffer.jsondeploy/grafana/dashboards/vector_auto_buffer.jsondeploy/grafana/dashboards/compressed_wal_shipping.json
Alle neuen Endpoints:
- Erfordern Standard-Authentifizierung (Bearer Token / API Key)
- Admin-Operationen (
/buffer/flush) erfordern Admin-Rolle
Empfohlene Limits:
/ts/put/buffered: 10,000 requests/minute
/vectors/add/buffered: 5,000 requests/minute
/buffer/flush: 10 requests/minute (admin only)
Neue Environment Variables:
# TSAutoBuffer
THEMIS_TS_AUTO_BUFFER_ENABLED=true
THEMIS_TS_AUTO_BUFFER_MAX_POINTS=1000
THEMIS_TS_AUTO_BUFFER_FLUSH_INTERVAL_MS=5000
# VectorAutoBuffer
THEMIS_VECTOR_AUTO_BUFFER_ENABLED=true
THEMIS_VECTOR_AUTO_BUFFER_MAX_VECTORS=1000
# Compressed WAL Shipping
THEMIS_WAL_COMPRESSION=zstd
THEMIS_WAL_COMPRESSION_LEVEL=3Updates erforderlich:
deploy/helm/themisdb/values.yaml- ConfigMap für Auto-Buffer Konfiguration
- Service definition für neue Endpoints
- Add
put_buffered()method to TimeSeriesClient - Add
add_buffered()method to VectorClient - Add buffer stats methods
- Add error handling for buffer overflow
- Update documentation
- Add integration tests
- Publish to PyPI
- Add buffered methods to TimeSeriesClient
- Add buffered methods to VectorClient
- Add TypeScript type definitions
- Update documentation
- Add integration tests
- Publish to npm
- Add buffered methods
- Add WAL compression support
- Update documentation
- Add integration tests
- Tag new release
- Add buffered methods
- Update documentation
- Publish to Maven Central
Implementierung:
# config/features.yaml
features:
ts_auto_buffer:
enabled: true
max_points_per_buffer: 1000
flush_interval_ms: 5000
vector_auto_buffer:
enabled: true
max_vectors_per_buffer: 1000
compressed_wal_shipping:
enabled: true
compression_type: zstd
compression_level: 3Bei Problemen:
- Feature Flags auf
falsesetzen - Server neu starten (Buffer werden geflusht)
- Clients verwenden alte Endpoints (
/ts/put,/vectors/add)
- Alle Unit-Tests erfolgreich (>95% Coverage)
- Integration-Tests erfolgreich
- HTTP API Endpoints funktionieren
- Binary Protocol funktioniert
- Client SDKs aktualisiert
- TSAutoBuffer: 10-50x Throughput-Verbesserung
- VectorAutoBuffer: 500x Throughput-Verbesserung
- Compressed WAL: 80-90% Bandbreiten-Reduktion
- Code Review abgeschlossen
- Security Scan erfolgreich
- Performance Benchmarks dokumentiert
- Dokumentation vollständig
Status: 🟡 In Progress
Implementiert:
- ✅ TSAutoBuffer (Core)
- ✅ VectorAutoBuffer (Core)
- ✅ Compressed WAL Shipping (Core)
In Arbeit:
- 🔄 Unit Tests
- 🔄 HTTP API Integration
- 🔄 Benchmarks
Ausstehend:
- ⏳ Binary Protocol Extensions
- ⏳ Client SDK Updates
- ⏳ End-to-End Tests
- ⏳ Documentation
Zeitplan: 4 Wochen bis vollständige Client-Integration
Autor: ThemisDB Team
Datum: 15. Dezember 2025
Review: Erforderlich vor Client SDK Release
ThemisDB v1.3.4 | GitHub | Documentation | Discussions | License
Last synced: January 02, 2026 | Commit: 6add659
Version: 1.3.0 | Stand: Dezember 2025
- Übersicht
- Home
- Dokumentations-Index
- Quick Reference
- Sachstandsbericht 2025
- Features
- Roadmap
- Ecosystem Overview
- Strategische Übersicht
- Geo/Relational Storage
- RocksDB Storage
- MVCC Design
- Transaktionen
- Time-Series
- Memory Tuning
- Chain of Thought Storage
- Query Engine & AQL
- AQL Syntax
- Explain & Profile
- Rekursive Pfadabfragen
- Temporale Graphen
- Zeitbereichs-Abfragen
- Semantischer Cache
- Hybrid Queries (Phase 1.5)
- AQL Hybrid Queries
- Hybrid Queries README
- Hybrid Query Benchmarks
- Subquery Quick Reference
- Subquery Implementation
- Content Pipeline
- Architektur-Details
- Ingestion
- JSON Ingestion Spec
- Enterprise Ingestion Interface
- Geo-Processor Design
- Image-Processor Design
- Hybrid Search Design
- Fulltext API
- Hybrid Fusion API
- Stemming
- Performance Tuning
- Migration Guide
- Future Work
- Pagination Benchmarks
- Enterprise README
- Scalability Features
- HTTP Client Pool
- Build Guide
- Implementation Status
- Final Report
- Integration Analysis
- Enterprise Strategy
- Verschlüsselungsstrategie
- Verschlüsselungsdeployment
- Spaltenverschlüsselung
- Encryption Next Steps
- Multi-Party Encryption
- Key Rotation Strategy
- Security Encryption Gap Analysis
- Audit Logging
- Audit & Retention
- Compliance Audit
- Compliance
- Extended Compliance Features
- Governance-Strategie
- Compliance-Integration
- Governance Usage
- Security/Compliance Review
- Threat Model
- Security Hardening Guide
- Security Audit Checklist
- Security Audit Report
- Security Implementation
- Development README
- Code Quality Pipeline
- Developers Guide
- Cost Models
- Todo Liste
- Tool Todo
- Core Feature Todo
- Priorities
- Implementation Status
- Roadmap
- Future Work
- Next Steps Analysis
- AQL LET Implementation
- Development Audit
- Sprint Summary (2025-11-17)
- WAL Archiving
- Search Gap Analysis
- Source Documentation Plan
- Changefeed README
- Changefeed CMake Patch
- Changefeed OpenAPI
- Changefeed OpenAPI Auth
- Changefeed SSE Examples
- Changefeed Test Harness
- Changefeed Tests
- Dokumentations-Inventar
- Documentation Summary
- Documentation TODO
- Documentation Gap Analysis
- Documentation Consolidation
- Documentation Final Status
- Documentation Phase 3
- Documentation Cleanup Validation
- API
- Authentication
- Cache
- CDC
- Content
- Geo
- Governance
- Index
- LLM
- Query
- Security
- Server
- Storage
- Time Series
- Transaction
- Utils
Vollständige Dokumentation: https://makr-code.github.io/ThemisDB/