https://github.com/jurshsmith/vaultstream
High-Performance Distributed Digital Signature System
https://github.com/jurshsmith/vaultstream
cryptography ecdsa-key-pair golang jetstream nats-streaming postgresql
Last synced: 2 months ago
JSON representation
High-Performance Distributed Digital Signature System
- Host: GitHub
- URL: https://github.com/jurshsmith/vaultstream
- Owner: Jurshsmith
- Created: 2025-07-01T12:34:43.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-01T13:23:47.000Z (12 months ago)
- Last Synced: 2025-07-01T14:30:10.163Z (12 months ago)
- Topics: cryptography, ecdsa-key-pair, golang, jetstream, nats-streaming, postgresql
- Language: Go
- Homepage:
- Size: 1.09 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ VaultStream
> **High-Performance Distributed Digital Signature System**
> A microservices-based cryptographic infrastructure for secure record signing at scale, built with Go and event-driven architecture.




---
## โจ Overview
VaultStream is a production-ready distributed system designed for high-throughput digital signature operations. It demonstrates enterprise-grade patterns including event-driven microservices, concurrent processing, and cryptographic best practices.
### ๐ฏ Key Features
- **๐ ECDSA Cryptography** - P-256 curve key generation and digital signatures
- **โก High Concurrency** - Configurable goroutine pools with semaphore-based flow control
- **๐ Batch Processing** - Optimized bulk operations with chunking and parallel execution
- **๐ Event-Driven Architecture** - NATS JetStream for reliable message delivery
- **๐๏ธ Resilient Data Layer** - PostgreSQL with Ent ORM and migration support
- **๐ Performance Tuning** - Configurable batch sizes and concurrency levels
- **๐งช Production Testing** - Integration tests with real database connections
## ๐๏ธ Architecture
### System Components
```
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Keys Service โ โ Records Service โ โ Signing Service โ
โ โ โ โ โ โ
โ โข ECDSA Key Gen โ โ โข Batch Queries โ โ โข Concurrent โ
โ โข Key Streaming โ โ โข Record Publish โ โ Signing โ
โ โข Concurrency โโโโโโค โข DB Integration โโโโโโค โข Bulk Inserts โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโ
โ NATS JetStream โ
โ โข Event Streaming โ
โ โข Durable Consumers โ
โ โข Message Persistence โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโผโโโโโโโโโโโโโ
โ PostgreSQL โ
โ โข Records Table โ
โ โข Signatures Table โ
โ โข ACID Compliance โ
โโโโโโโโโโโโโโโโโโโโโโโโโ
```

## ๐ Quick Start
**One-command setup:**
```bash
make quick-start
```
This command will:
- โ
Set up environment configuration
- โ
Verify prerequisites (Go, Docker, Make)
- โ
Launch PostgreSQL and NATS infrastructure
- โ
Seed database with configurable record count
- โ
Start all microservices concurrently
### ๐๏ธ Performance Tuning
Adjust these variables in the generated `.env` file to observe system behavior at different scales:
```bash
BATCH_SIZE=50 # Records per batch (impacts memory vs. throughput)
TOTAL_RECORDS=1000 # Scale of the signing workload
RECORDS_MAX_CONCURRENCY=10 # Parallel batch processing
SIGNER_MAX_CONCURRENCY=8 # Concurrent signature operations
```
## ๐ ๏ธ Tech Stack
| Category | Technology | Purpose |
| -------------------- | -------------- | --------------------------------------- |
| **Language** | Go 1.18+ | High-performance concurrent programming |
| **Message Broker** | NATS JetStream | Event streaming with persistence |
| **Database** | PostgreSQL | ACID-compliant data storage |
| **ORM** | Ent | Type-safe database operations |
| **Cryptography** | ECDSA P-256 | Industry-standard digital signatures |
| **Containerization** | Docker Compose | Local development infrastructure |
## ๐ Data Model
### Database Tables
- **`records`** - Source data requiring digital signatures
- **`signatures`** - Cryptographic signatures with key associations
### Message Streams
- **`records.>`** - Batch record publishing for signature processing
- **`keys.>`** - Cryptographic key distribution and lifecycle management
## ๐ง Prerequisites
Ensure the following tools are installed:
| Tool | Version | Installation |
| ---------- | ------- | ----------------------------------------------------------------- |
| **Go** | 1.18+ | [golang.org/dl](https://golang.org/dl/) |
| **Docker** | 20.10+ | [docs.docker.com/get-docker](https://docs.docker.com/get-docker/) |
| **Make** | Any | Xcode CLI Tools (macOS) or package manager (Linux) |
## ๐ Available Commands
```bash
make help # Show all available commands
make quick-start # Complete setup and launch
make start # Launch services (after setup)
make test # Run integration test suite
make stop # Stop all services and cleanup
make clean # Reset volumes and cached data
```
## ๐ฎ Roadmap
### Performance & Reliability
- [ ] **Retry Strategies** - Exponential backoff with jitter for transient failures
- [ ] **Circuit Breakers** - Fault tolerance for downstream dependencies
- [ ] **Metrics & Observability** - Prometheus metrics and distributed tracing
### Infrastructure & Deployment
- [ ] **Kubernetes Deployment** - Helm charts for container orchestration
- [ ] **Auto-scaling** - Horizontal pod autoscaling based on queue depth
- [ ] **Health Checks** - Comprehensive readiness and liveness probes
### Testing & Quality
- [ ] **Expanded Test Coverage** - Unit tests for critical cryptographic functions
- [ ] **Load Testing** - Performance benchmarks under high concurrency
- [ ] **Security Audit** - Formal review of cryptographic implementations
---
**๐ข Enterprise-Ready Features:** Structured logging โข Graceful shutdowns โข Database migrations โข Configuration management โข Error handling โข Concurrent processing