System architecture
Blnk operates as a distributed system with three core components:- API Server: Manages incoming HTTP requests and API operations.
- Worker: Processes background jobs and handles asynchronous tasks.
- Migration Service: Oversees database schema updates and management.
- PostgreSQL: Primary database.
- Redis: Used for caching and message queues.
- Typesense: Provides search functionality.
- Jaeger (optional): Enables distributed tracing.
Deployment options
This guide covers two primary deployment strategies, each suited to different operational needs.-
Single server deployment:
- Development environments
- Small to medium-scale production deployments
- Teams with limited operational overhead
- Quick setup requirements
-
Kubernetes deployment:
- Large-scale production environments
- High availability requirements
- Teams with existing Kubernetes expertise
- Systems requiring sophisticated scaling capabilities
1. Single Server Deployment
1
Prerequisites
Ensure you have the following available or installed:
- Linux server (Ubuntu 20.04 LTS or newer recommended)
- Docker Engine 20.10+
- Docker Compose 2.0+
- Managed PostgreSQL instance
- Managed Redis instance
2
Configuration
Create or update your
blnk.json
configuration file. Learn more: Advanced configurationblnk.json
3
Create a "docker-compose.yml" file
Copy and paste the following configuration into your file to get started. This setup includes the API server, worker, and migration services for seamless deployment.
docker-compose.yml
4
Start deployment
Run the following docker commands:
2. Kubernetes Deployment
Blnk provides comprehensive Kubernetes manifests for streamlined deployment and management in containerized environments. These manifests help you quickly set up, scale, and manage Blnk in production or development clusters. You can find the official manifests and instructions here:infrastructure/k8s-manifests
Blnk Kubernetes Manifests
Production considerations
1. Security
- Network Security
- Enable SSL/TLS for all external connections
- Implement proper network policies
- Use secret management solutions
- Regular security updates
- Access Control
- Implement proper authentication
- Use role-based access control
- Regular audit of access patterns
2. Monitoring
- System Metrics
- CPU utilization
- Memory usage
- Disk I/O
- Network traffic
- Application Metrics
- Request latency
- Error rates
- Queue depths
- Processing times
3. Backup and Recovery
- Database Backups
- Regular automated backups
- Point-in-time recovery capability
- Backup testing procedures
- Configuration Management
- Version control for configurations
- Documentation of deployment procedures
- Disaster recovery planning
Troubleshooting guide
Here are common issues to check for if you encounter any problems during deployment:- Database Connectivity
- Verify network security groups
- Check connection strings
- Validate database credentials
- Worker Processing
- Monitor Redis connectivity
- Check worker logs
- Verify queue configuration
- Migration Issues
- Verify database permissions
- Check migration logs
- Validate schema versions
Support resources
- Log Analysis
- Check application logs (
docker-compose logs
orkubectl logs
) - Review system logs
- Monitor error tracking systems
- Check application logs (
- Performance Issues
- Review resource utilization
- Check database performance
- Monitor network latency
- Additional Support
- Technical documentation
- Community forums
- Support channels