๐๏ธ System Architecture Blueprint
The Veloctra Data Platform is engineered as an enterprise-grade, zero-memory-leak, high-throughput data streaming platform built on top of modular Python/FastAPI packages and React 18 frontend consoles.
- Visual DAG Builder with 1-Click Validation
- Live YAML Editor with Schema Autocomplete
- Interactive Connection Credential Vault
- Sub-second Throughput Sparklines & Gauges
- Live MemoryGuard RAM / CPU Pressure Telemetry
- Instant Row Counter & Execution Heartbeat
- Single-command platform lifecycle control
- CI/CD GitOps pipeline triggers & imports
- Docker Compose container auto-bootstrap
- JWT Multi-Tenant Auth with 5-Role RBAC
- Dynamic YAML Pipeline Compiler & Validator
- High-Frequency WebSocket Broadcast Hub
- Deterministic State Machine (CREATED โ COMPLETED)
- Atomic Checkpointing & Offset Tracking
- MongoDB (
veloctra_system) & SQLite Store
- Layer 1: Fernet (AES-128-CBC + HMAC-SHA256)
- Layer 2: ChaCha20-Poly1305 AEAD + Tenant AAD
- Zero-Downtime KeyRotationManager (v1 โ v2)
- Intelligent MemoryGuard (75% RAM / CPU Ceiling)
- Dynamic Chunk Sizing: 10,000 โ 50 โ 1 row
- Circuit Breaker with AWS Full Jitter Backoff
- PyArrow & Polars SIMD Columnar Transforms
- Field-Level Column Cipher (AES-256-GCM)
- WeakRef Plugin Registry & Sanitized Sandboxing
- Row-by-Row Fallback on Poison Pill batches
- Corrupt records quarantined to DLQ sink
- Non-blocking pipeline execution guarantee
- High-speed
asyncpgbinary copy streams - Auto-partitioning cursor pagination queries
- Transactional WAL mode with zero table lock
- MongoDB Bulk Write unordered batches
- Cassandra token-aware partition ranges
- Redis Streams low-latency queue buffers
- Snappy / Zstandard columnar Parquet writing
- Auto-rotating
FilePartitioner(Size / Row limits) - Direct streaming to AWS S3 & Google Cloud Storage
๐ฆ Monorepo Package Directory
The core platform is strictly divided into 8 isolated packages inside packages/:
| Package | Location | Core Responsibility |
|---|---|---|
veloctra-core |
packages/veloctra-core |
Settings management (Pydantic), logging formats, and core protocol schemas. |
veloctra-security |
packages/veloctra-security |
Double Envelope Encryption (Fernet + ChaCha20-Poly1305), KeyRotationManager, and 5-role RBAC. |
veloctra-state |
packages/veloctra-state |
Deterministic 11-State FSM, checkpoint engine, and MongoDB (veloctra_system) / SQLite store. |
veloctra-resilience |
packages/veloctra-resilience |
Circuit Breaker automaton (CLOSED/OPEN/HALF_OPEN) and AWS Full Jitter retry backoff. |
veloctra-connectors |
packages/veloctra-connectors |
Streaming drivers for PostgreSQL, MySQL, SQLite, MongoDB, Cassandra, Redis, and Universal File System. |
veloctra-transformers |
packages/veloctra-transformers |
PyArrow & Polars vectorized transforms, AES-256-GCM cipher engine, and auto-sized FilePartitioner. |
veloctra-orchestrator |
packages/veloctra-orchestrator |
Stream execution coordinator, MemoryGuard resource governor, and DLQ row-by-row fallback handler. |
veloctra-api |
packages/veloctra-api |
FastAPI application gateway, JWT auth middleware, and sub-second WebSocket telemetry broadcaster. |
๐ Deterministic 11-State Finite State Machine (FSM) Workflow
Pipeline lifecycles are governed by a strictly validated state machine preventing race conditions, resource starvation, and inconsistent progress:
COMPLETED.EXTRACTING.
TRANSFORMING.
๐ Double Envelope AEAD Encryption & Key Rotation
To eliminate credential leakage from static configuration files, database connections and API tokens are double-encrypted with zero-plaintext exposure:
Zero-Downtime Key Rotation: The KeyRotationManager maintains versioned keyrings. When keys are rotated to v2, existing tokens under v1 remain decryptable, while all new or updated credentials are encrypted under v2 seamlessly.
๐ก๏ธ In-Memory Field-Level Column Encryption (AES-256-GCM)
For sensitive PII, PHI, and financial attributes, Veloctra provides in-memory vector column encryption before writing batches to disk or cloud destinations:
Vector Column Ciphers
Operates directly on PyArrow chunks using SIMD instructions, encrypting column records without decompressing surrounding dataset rows.
AES-256-GCM Authenticated Cipher
Generates fresh 96-bit cryptographic nonces per cell, appending 128-bit authentication tags to prevent data tampering.
Declarative YAML Policies
Easily define encrypted fields via configuration: fields_to_encrypt: ["ssn", "claim_amount", "card_number"].
๐ฅ 5-Role Multi-Tenant Access Control (RBAC)
Control plane endpoints enforce tenant-bound Role-Based Access Control to ensure strict isolation:
| Role | Allowed Operations | Authorization Scope |
|---|---|---|
SUPER_ADMIN |
Full administrative control, global key rotation, server telemetry, tenant provisioning. | Platform-wide |
TENANT_ADMIN |
Create pipelines, manage tenant secrets, invite users, configure alert webhooks. | Tenant-isolated |
DATA_ENGINEER |
Author and test pipelines, configure transforms, manage schemas, inspect DLQ. | Tenant-isolated |
OPERATOR |
Trigger pipeline runs, pause/resume execution, view live progress and logs. | Tenant-isolated |
AUDITOR |
Read-only inspection of audit events, FSM transitions, and compliance checkpoints. | Tenant-isolated |
โก Universal Pluggable Streaming & Messaging Architecture
Veloctra is built around an open, extensible plugin model: streaming services are never hardcoded or limited to specific vendors. Through BaseStreamingConnector and the dynamic StreamingConnectorRegistry, users can plug in any streaming broker (Kafka, RabbitMQ, AWS SQS, Redis Streams, NATS, GCP Pub/Sub, Azure Event Hubs, MQTT, or custom internal queue systems):
Open Plugin Contract
Implement 4 simple async methods (connect, close, stream_read, publish_batch) to integrate any message broker without modifying platform core code.
Dynamic Discovery & Loading
Reference custom connectors in pipeline YAML via plugin_file: "plugins/custom_nats.py" or plugin_module: "my_org.solace" with runtime hot-loading.
Ultra-Lightweight Footprint (< 40MB RAM)
Core platform has zero heavy broker dependencies. Client libraries (e.g. aiokafka, redis, aiobotocore) load lazily on-demand, allowing Veloctra to run in lightweight micro-containers and edge pods.
๐ Custom Script Transformation Engine (UI & CI/CD Import)
For complex business logic, risk modeling, and advanced feature engineering beyond standard schema mapping, users can execute custom Python scripts:
Inline UI Scripting
Define custom Python code directly in the pipeline designer with live dry-run validation via the /scripts/validate REST API.
CI/CD Module Import
Import external scripts, shared organizational packages, and Git repository modules seamlessly via script_path or module_name.
Multi-Framework Adapters
Author logic with your choice of framework: def transform(batch: pa.RecordBatch), def transform_df(df: pd.DataFrame), or def transform_polars(df: pl.DataFrame).
๐ Universal Change Data Capture (CDC) Architecture & Engine
The Veloctra platform delivers an enterprise-grade Change Data Capture (CDC) framework that both implements its own vectorized delta/hash-diff engines in-app and integrates with external real-time log streams. It enables zero-data-loss synchronization, sub-second delta streaming, and legacy database replication without demanding heavy external agents such as Debezium or Kafka Connect.
1. High-Watermark Delta Sync
For tables with timestamp columns (e.g. updated_at, created_at) or monotonically increasing IDs. Injects dynamic SQL/NoSQL filter clauses at extraction time and updates checkpoints automatically.
2. Checksum Hash-Diff CDC
Built for legacy databases with zero timestamp columns, no triggers, and no replication log access. Maintains persistent SHA-256 row-level hash states to detect INSERT, UPDATE, and DELETE events.
3. Oplog Change Stream CDC
Real-time log-based CDC listening to database change feeds (e.g. MongoDB coll.watch() with resume_after tokens, Redis Streams, or Kafka log topics) converted to standardized PyArrow batches.
WHERE updated_at > 'last_wm'), SHA-256 hash comparison across non-key fields, or MongoDB change streams.RecordBatch with operation tags: INSERT, UPDATE, or DELETE, alongside epoch timestamps and compound primary key values.pyarrow.compute.equal(_cdc_op, "DELETE") splits the batch into:
โข Deletes: Targeted
SQLConnector.bulk_delete() using primary/match keys.
โข Upserts: High-throughput
bulk_upsert() (ON CONFLICT DO UPDATE) or MongoDB ReplaceOne(upsert=True).
๐ CDC Mode Capabilities & Trade-Offs
| CDC Mode | Supported Databases | Schema Changes Required? | Deletion Handling | Throughput Profile |
|---|---|---|---|---|
| High-Watermark Delta Sync | PostgreSQL, MySQL, SQLite, MongoDB, Cassandra, DynamoDB | Requires timestamp or sequential integer column (e.g. updated_at, id) |
Soft deletes only (e.g. is_deleted = true) |
โก Ultra-Fast (120,000+ rows/sec) |
| Checksum Hash-Diff CDC | Any SQL / NoSQL / Flat File / CSV source without timestamps | Zero modifications. Works on legacy & read-only replicas | Full hard-delete capture (missing key detection) | โก High (50,000+ rows/sec with SHA-256 SIMD) |
| MongoDB Change Streams / Oplog | MongoDB Replica Sets / Atlas, Redis Streams, Kafka | None (Native database binlog / oplog stream) | Full hard & soft delete capture via change event tags | โก Real-time continuous streaming (< 50ms latency) |
โ๏ธ Offset Governance & Conflict Policies (UI & API)
When updating an active CDC streaming pipeline, Veloctra enforces atomic checkpoint safety to avoid silent duplication or skipped records:
๐งช Example: Hybrid High-Watermark CDC Pipeline YAML
# Veloctra CDC Streaming Configuration
pipeline_id: postgres_to_mongo_cdc
project_id: healthcare_prod_workspace
tenant_id: healthcare_prod_workspace
version: 2
settings:
chunk_size: 5000
max_memory_percent: 75.0
dlq_enabled: true
sources:
- name: pg_healthcare_claims
type: database
connection_string: "enc:v1:..."
query: "SELECT * FROM raw_claims"
chunk_size: 5000
delta:
watermark_column: updated_at
watermark_type: timestamp
initial_watermark: "2026-01-01T00:00:00"
destinations:
- name: mongo_claims_collection
type: nosql
db_type: mongodb
connection_string: "enc:v1:..."
database: healthcare_dw
collection: claims_stream
upsert_key: ClaimId
batch_size: 5000
โก 5. Intelligent Migration Sizing & KEDA Elastic Autoscaling
Veloctra combines in-pod micro-level protection with Kubernetes cluster macro-level elasticity through its integrated Migration Sizing Engine and KEDA (Kubernetes Event-Driven Autoscaling) controller:
1. Source Volume Discovery
Scans SQL table catalogs (pg_class.reltuples, SELECT COUNT(*)), MongoDB collection metadata (count_documents), and file metadata to calculate exact pending rows and payload size.
2. Prometheus Metric Pipeline
Emits real-time gauges: veloctra_migration_workload_demand_replicas and veloctra_migration_pending_rows on /metrics for KEDA to scrape with zero broker dependencies.
3. Two-Tier Scale Up & Down
MemoryGuard prevents OOM crashes within < 1ms, while KEDA horizontally scales worker pods (1 → 16) and smoothly drains them upon completion with a 5-minute cooldown.
# Production KEDA ScaledObject Manifest (deploy/k8s/keda_scaledobject.yaml)
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: veloctra-engine-autoscaler
namespace: veloctra
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: veloctra-engine
pollingInterval: 15
cooldownPeriod: 300
minReplicaCount: 1
maxReplicaCount: 16
triggers:
- type: prometheus
metadata:
serverAddress: http://prometheus-k8s.monitoring.svc:9090
metricName: veloctra_migration_workload_demand_replicas
query: sum(veloctra_migration_workload_demand_replicas)
threshold: "1"