Supported Versions
Zerops currently supports NATS version 2.10. When importing a service, use version format:Service Configuration
Our NATS implementation features optimized default settings designed for common use cases. Key configuration aspects include:- Standard protocol port
4222for client connections - HTTP monitoring interface
8222for management - Secure authentication with automatically generated credentials
- Optimized settings for performance and reliability
Available Configuration Options
You can fine-tune your NATS service by adjusting environment variables:If certain variables are not visible in your configuration, they may have been introduced after your service was created. Simply add them as secret variables to access the functionality.
| Variable | Description |
|---|---|
MAX_PAYLOAD | Defines the maximum allowed message size for all NATS traffic. Default: 8MB, Maximum: 64MB. See NATS limits documentation for details. |
JET_STREAM_ENABLED | Controls whether JetStream functionality is enabled. Default: 1 (enabled), Set to 0 to disable. |
JetStream Configuration
The service includes JetStream functionality enabled by default, providing persistent storage capabilities for your messaging workloads:- Memory store: Up to 40GB for high-performance message caching
- File store: Up to 250GB for persistent storage
- Regular sync intervals: Ensures data durability and consistency
In HA deployments, data persistence is further enhanced with 1-minute sync intervals across all nodes, ensuring robust data durability and high availability.
Deployment Modes
Non-HA Mode
- Suitable for development and testing
- Data persistence not guaranteed during node failures
- Lower resource requirements
HA Mode
- Creates a multi-node NATS cluster
- Configures routes between cluster nodes automatically
- Implements NATS clustering for high availability
- Provides improved reliability compared to non-HA deployments
Authentication Management
Authentication credentials are automatically generated and managed by the platform. The system creates a default user (zerops) with a secure 16-character password. You can access these credentials through:
- The service access details in the Zerops GUI
- Environment variables in your service configuration:
user- Username for authentication (default: “zerops”)password- Generated secure passwordconnectionString- Complete connection string in the formatnats://${dbUser}:${dbPassword}@${hostname}:${port}
Connection Examples
Node.js
Python
Go
Health Monitoring
Zerops continuously monitors your NATS service health using built-in health checks:- HTTP Health Check: The system checks the
/healthzendpoint at port 8222 - Self-Healing: The platform automatically recovers unhealthy nodes when issues are detected
Health Status
You can check the health status of your NATS service:- Through the Zerops GUI dashboard
- By accessing the management interface at port
8222
Backup and Recovery
NATS backups are created using filesystem archival:- Format:
.tar.gz(archive of queue state) - Tooling: Filesystem archival
- Content: Captures persistent message state
Restoring Backups
To restore a NATS backup:- Download the backup file (
.tar.gz) from the Zerops UI - Extract the archive to access the queue state data
- Prepare your target environment (clear existing data if needed)
- Restore using NATS CLI commands via Zerops VPN or during deployment. Follow the official NATS documentation for detailed restore procedures.
Use Cases
NATS excels in:- Microservices Communication - Lightweight, fast inter-service messaging
- Event-Driven Architecture - Publish-subscribe patterns for event distribution
- Request-Reply Patterns - Synchronous communication with built-in timeout
- Stream Processing - Real-time data processing with JetStream
- IoT & Edge Computing - Efficient messaging for resource-constrained environments
- Multi-tenant Applications - Subject-based isolation and routing
Best Practices
Performance
- Use subject hierarchies for efficient routing
- Implement proper message batching where applicable
- Monitor JetStream storage usage
- Configure appropriate message limits for your workload
Reliability
- Use JetStream for critical messages requiring persistence
- Implement proper error handling and reconnection logic
- Monitor consumer lag in stream processing
- Use HA mode for production workloads
Security
- Store credentials in environment variables
- Use subject-based authorization where needed
- Implement TLS for sensitive data (contact support)
- Rotate credentials periodically
Support
For advanced configurations or custom requirements:- Join our Discord community
- Contact support via email