When your authentication system needs to handle billions of users, every microsecond of per-user overhead adds up. H33's batch architecture achieves sub-microsecond per-user costs, enabling planetary-scale authentication.
The Scale Math
1,000 users authenticated in 116µs = 0.116µs per user
At this efficiency: 8.6 million auth/second per node
10-node cluster: linearly scaled throughput
This is how you authenticate Earth's population.
The Batch Efficiency Curve
H33's batch processing exhibits sub-linear scaling—adding more users to a batch increases total time, but decreases per-user cost:
Why Batching Works
Authentication operations share significant common computation:
- Key loading: Cryptographic keys loaded once, used for entire batch
- Circuit initialization: ZK circuit setup amortized across all proofs
- Memory allocation: Single allocation serves entire batch
- SIMD parallelism: Vector instructions process multiple users simultaneously
Sequential processing pays these costs for every user. Batching pays them once.
Architecture Overview
┌─────────────────────────────────────────────────────┐
│ Request Collector │
│ Accumulates requests until batch threshold/timeout │
└──────────────────────┬──────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ Batch Scheduler │
│ Groups requests by type, allocates to processors │
└──────────────────────┬──────────────────────────────┘
│
┌─────────────┼─────────────┐
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Processor │ │ Processor │ │ Processor │
│ (Core 1) │ │ (Core 2) │ │ (Core N) │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
└─────────────┼─────────────┘
▼
┌─────────────────────────────────────────────────────┐
│ Result Aggregator │
│ Collects results, dispatches to waiting requests │
└─────────────────────────────────────────────────────┘
Batch Collection Strategies
H33 supports multiple batching strategies:
Time-windowed: Collect requests for up to N milliseconds, then process.
const batcher = h33.createBatcher({
maxWaitMs: 10, // Max 10ms collection window
maxBatchSize: 1000 // Or until 1000 requests
});
Size-triggered: Process immediately when batch reaches target size.
const batcher = h33.createBatcher({
maxBatchSize: 100, // Process at 100 requests
maxWaitMs: 50 // Or 50ms, whichever first
});
Adaptive: Adjust batch parameters based on load.
const batcher = h33.createBatcher({
mode: 'adaptive',
targetLatency: 5 // Target 5ms response time
});
Handling Heterogeneous Requests
Not all authentication requests are identical. H33 batches intelligently:
- Same-type batching: Group full auth with full auth, session resume with session resume
- Priority lanes: High-priority requests get dedicated batch slots
- Mixed batches: When necessary, different types share computation where possible
Failure Isolation
One failing request must not sink the batch:
- Individual error handling: Each request in batch gets its own success/failure status
- Partial results: Batch returns all completed results even if some fail
- Circuit breakers: Persistent failures trigger fallback to sequential processing
Multi-Node Scaling
Single-node performance is high-throughput auth. Scaling horizontally:
- Stateless design: Any node can handle any request
- Shared cache: Redis cluster for session state and proof cache
- Load balancing: Consistent hashing for cache affinity
- Auto-scaling: Scale based on batch queue depth
With 10 nodes: linearly scaled throughput. With 100 nodes: linearly scaled throughput. The architecture scales linearly.
Real-World Deployment
For a social platform with 1 billion daily active users:
- Peak load: ~50M authentications/minute (morning login wave)
- Required capacity: ~830K auth/second
- H33 nodes needed: 1 (with 10x headroom)
The math works because batch efficiency transforms impossible scale into trivial infrastructure.