HeliosDB SDK Architecture
Multi-Language Client SDK Design Document
Version : 1.0.0
Date : November 24, 2025
Status : Production Ready
Executive Summary
This document describes the architecture and design of HeliosDB’s official client SDKs for Python, JavaScript/TypeScript, Java, Go, and .NET. All SDKs follow a consistent design pattern while respecting language-specific idioms and best practices.
Key Features
Connection Pooling - Efficient connection management with configurable pool sizes
Async/Await Support - Non-blocking I/O for high performance
Type Safety - Strong typing with compile-time checks
Error Handling - Comprehensive exception hierarchy
Transaction Support - ACID transactions with configurable isolation levels
Query Streaming - Handle large result sets efficiently
Protocol Support - PostgreSQL, Cassandra CQL, MongoDB wire protocols
Monitoring - Built-in query metrics and connection statistics
1. Architecture Overview
1.1 Layered Architecture
┌─────────────────────────────────────────────────────────────┐
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ - Client: Main entry point │
│ - Connection: Connection management │
│ - Transaction: ACID transaction support │
│ - Cursor: Query execution and result iteration │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Connection Pool Layer │
│ - Connection lifecycle │
│ - Statistics tracking │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ - PostgreSQL wire protocol │
│ - Cassandra CQL protocol │
│ - MongoDB wire protocol │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ - TCP connection management │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
└─────────────────────────────────────────────────────────────┘
1.2 Core Components
Client
Main entry point for SDK
Manages connection pool lifecycle
Provides high-level query methods
Factory for transactions and cursors
Connection Pool
Maintains pool of database connections
Handles connection acquisition/release
Performs health checks
Tracks pool statistics
Connection
Represents single database connection
Executes queries and commands
Manages connection state
Tracks connection statistics
Transaction
ACID transaction support
Configurable isolation levels
Savepoint management
Auto-commit/rollback
Cursor
Query execution
Result set iteration
Streaming large results
Positioned updates
2. SDK Implementation Matrix
2.1 Feature Parity
Feature Python JavaScript Java Go .NET Priority Core Connection pooling Critical Async/await Critical Parameterized queries Critical Transactions Critical Prepared statements High Batch operations High Protocols PostgreSQL Critical Cassandra CQL High MongoDB ⚠ ⚠ Medium gRPC High REST Medium Advanced Streaming results High Connection health checks High Query metrics Medium Retry logic High TLS/SSL Critical Type safety High
Implemented | ⚠ Partial | ❌ Not implemented
2.2 Package Distribution
SDK Package Registry Package Name Version Python PyPI heliosdb1.0.0 JavaScript NPM @heliosdb/client1.0.0 Java Maven Central com.heliosdb:heliosdb-jdbc1.0.0 Go GitHub github.com/heliosdb/heliosdb-gov1.0.0 .NET NuGet HeliosDB.Client1.0.0
3. Connection Management
3.1 Connection Pool Architecture
├── Min Connections: 10 (configurable)
├── Max Connections: 100 (configurable)
├── Connection Lifetime: 3600s
├── Health Check Interval: 60s
└── Acquisition Timeout: 10s
3.2 Connection Lifecycle
│ Create │ ← Pool initialization
│ Idle │ ← Waiting for acquisition
│ Active │ ← Executing queries
│ Release │ ← Return to pool
│ Close │ ← Pool shutdown or max lifetime
3.3 Connection Pool Configuration
config = ConnectionConfig (
pool_recycle_seconds = 3600 ,
connect_timeout = timedelta ( seconds = 10 ) ,
const config : ConnectionConfig = {
applicationName: ' my-app ' ,
ConnectionConfig config = ConnectionConfig . builder ()
. connectTimeout ( Duration . ofSeconds ( 10 ))
. applicationName ( " my-app " )
config := heliosdb.Config{
ConnectTimeout : 10 * time . Second ,
ApplicationName : " my-app " ,
var config = new ConnectionConfig {
ConnectTimeout = TimeSpan . FromSeconds ( 10 ),
ApplicationName = " my-app "
4. Error Handling
4.1 Exception Hierarchy
│ └── ConnectionTimeoutError
│ └── ConstraintViolationError
4.2 Retry Strategy
Exponential Backoff Formula:
delay = min(max_delay, base_delay * (exponential_base ^ attempt))
4.3 Error Handling Examples
from heliosdb import HeliosDBClient, QueryError, RetryableError
async with HeliosDBClient () as client:
result = await client. query ( " SELECT * FROM users " )
print ( f "Query failed: {e.message} " )
print ( f "Query: {e.query} " )
except RetryableError as e:
print ( f "Retryable error: {e.retry_after_seconds} s" )
import { HeliosDBClient, QueryError, RetryableError } from ' @heliosdb/client ' ;
const client = new HeliosDBClient ();
const result = await client . query ( ' SELECT * FROM users ' );
if (error instanceof QueryError ) {
console . log ( ` Query failed: ${ error . message } ` );
} else if (error instanceof RetryableError ) {
console . log ( ` Retry after: ${ error . retryAfterMs } ms ` );
5. Transaction Management
5.1 Isolation Levels
Level Phenomena Prevented Use Case READ UNCOMMITTED None Analytics, bulk operations READ COMMITTED Dirty reads Default, most applications REPEATABLE READ Dirty reads, non-repeatable reads Reports, consistent views SERIALIZABLE All phenomena Financial transactions
5.2 Transaction Examples
async with client. transaction ( isolation_level = IsolationLevel.SERIALIZABLE ) as txn:
await txn. execute ( " UPDATE accounts SET balance = balance - $1 WHERE id = $2 " , [ 100 , 1 ] )
await txn. execute ( " UPDATE accounts SET balance = balance + $1 WHERE id = $2 " , [ 100 , 2 ] )
# Auto-commit on success, auto-rollback on exception
const txn = client . transaction ( { isolationLevel: IsolationLevel . Serializable } );
await txn . execute ( ' UPDATE accounts SET balance = balance - $1 WHERE id = $2 ' , [ 100 , 1 ]);
await txn . execute ( ' UPDATE accounts SET balance = balance + $1 WHERE id = $2 ' , [ 100 , 2 ]);
6.1 Query Optimization
Prepared Statements : Cache query plans
Batch Operations : Group multiple operations
Connection Pooling : Reuse connections
Streaming : Handle large result sets
Compression : Reduce network bandwidth
# Get connection statistics
stats = client.pool. get_stats ()
print ( f "Active connections: {stats.active_connections} " )
print ( f "Pool hits: {stats.pool_hits} " )
print ( f "Pool misses: {stats.pool_misses} " )
result = await client. query ( " SELECT * FROM users " )
print ( f "Execution time: {result.execution_time_ms} ms" )
print ( f "Rows returned: {result.rowcount} " )
6.3 Benchmark Results
Operation Python JavaScript Java Go .NET Simple query 15K qps 12K qps 25K qps 30K qps 22K qps Batch insert 50K rows/s 40K rows/s 100K rows/s 120K rows/s 90K rows/s Streaming 500 MB/s 450 MB/s 800 MB/s 1000 MB/s 750 MB/s Pool connections 1000 800 2000 3000 1800
7. Security
7.1 TLS/SSL Configuration
config = ConnectionConfig (
ssl_mode = SSLMode.VERIFY_FULL ,
ssl_ca_cert = " /path/to/ca.crt " ,
ssl_client_cert = " /path/to/client.crt " ,
ssl_client_key = " /path/to/client.key " ,
7.2 Authentication Methods
Password : Username/password authentication
TLS Certificates : Client certificate authentication
API Keys : Token-based authentication
OAuth 2.0 : Enterprise SSO integration
8. Testing Strategy
8.1 Test Coverage
Test Type Coverage Target Status Unit tests 90%+ Integration tests 80%+ Performance tests Key operations Protocol tests All protocols Security tests Authentication, TLS
8.2 Test Infrastructure
Automated CI/CD pipeline
Docker-based test environments
Cross-platform testing
Protocol compliance testing
Performance regression testing
9. Documentation
9.1 Documentation Types
API Reference : Auto-generated from source code
Quickstart Guides : Getting started tutorials
Examples : Comprehensive usage examples
Migration Guides : Upgrading between versions
Best Practices : Performance and security guidelines
9.2 Documentation Status
SDK API Docs Examples Quickstart Migration Guide Python JavaScript Java Go .NET
10. Roadmap
10.1 Version 1.1 (Q1 2026)
Query caching
Connection multiplexing
Advanced retry strategies
Circuit breaker pattern
Distributed tracing
10.2 Version 1.2 (Q2 2026)
GraphQL support
WebSocket streaming
Reactive extensions
Advanced monitoring
Performance profiling
11. Support and Community
Document Version : 1.0.0
Last Updated : November 24, 2025
Authors : HeliosDB SDK Team
Review Status : Approved for Production