Architecture

Security Isolation with NATS JetStream Messaging

Deployment Modes

Choose the architecture that matches your security requirements

Mini

Single binary for development and small workloads

  • All-in-one binary
  • No external dependencies
  • Lowest resource usage
  • Perfect for testing
Best for: Development, testing, small sites

Small

Two-process architecture with request/response separation

  • Frontend + Validator
  • NATS messaging
  • Process isolation
  • Production ready
Best for: SMB production deployments

Full

Four-process architecture with maximum isolation

  • 4 isolated processes
  • 4 separate NATS instances
  • Strong network isolation
  • BSI compliance ready
Best for: High-security environments

Data Flow Diagram

Complete request/response cycle through all 4 isolated security stages

Client
(Browser)
Frontend
NATS-1
dirty-req
Request
Validator
NATS-2
clean-req
Backend
Web Server
(Your App)
NATS-4
clean-resp
Response
Validator
NATS-3
dirty-resp
Request flow
Response flow
Audit log
NATS
Unvalidated data
NATS
Validated data

Data Flow (Full Mode)

Request Path

  1. Client sends HTTP request
  2. Frontend receives and forwards to NATS-1 (dirty-req)
  3. Request Validator validates against policy
  4. Clean request sent to NATS-2 (clean-req)
  5. Backend forwards to your web application

Response Path

  1. Your application sends response
  2. Backend receives and forwards to NATS-3 (dirty-resp)
  3. Response Validator sanitizes response
  4. Clean response sent to NATS-4 (clean-resp)
  5. Frontend returns sanitized response to client

Why 4 Separate NATS Instances?

Security Isolation

Each NATS instance is completely isolated. If an attacker compromises one component, they cannot access messages from other stages. Dirty (unvalidated) and clean (validated) data are never mixed.

Defense in Depth

Even if the Request Validator is bypassed, the Response Validator provides another layer of protection. Each stage operates independently with its own security boundary.

Audit Trail

All messages are logged to the audit system (syslog/OTLP). This provides a complete, immutable record of all HTTP traffic for compliance and forensics.

Performance

NATS JetStream provides high-throughput and low-latency messaging. The 4-stage architecture adds minimal overhead while providing maximum security.

Ready to Protect Your Web Applications?

Download the free version or contact us for enterprise solutions.