Blnk is a modern financial software designed for scalability and reliability. This guide outlines deployment strategies for operations of all sizes, ranging from development setups to full-scale production systems.
blnkfinance/blnk-infrastructure Terraform modules for setting up Blnk Finance on different cloud platforms (AWS, GCP, Azure, etc.)
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.
Supporting Infrastructure:
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
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
Configuration Create or update your blnk.json
configuration file. Learn more: Advanced configuration
{
"project_name" : "Blnk" ,
"data_source" : {
"dns" : "postgres://<user>:<password>@<host>:5432/blnk?sslmode=require"
},
"redis" : {
"dns" : "redis://:<password>@<host>:6379"
},
"server" : {
"port" : "5001" ,
"ssl" : false ,
"domain" : "your-domain.com"
},
"queue" : {
"monitoring_port" : "5004"
}
}
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.
version : "3.8"
services :
server :
image : ${BLNK_IMAGE:-jerryenebeli/blnk:0.10.2}
container_name : server
restart : on-failure
entrypoint : [ "/bin/sh" , "-c" ]
command :
- "blnk migrate up && blnk start"
environment :
TZ : ${TZ:-Etc/UTC}
OTEL_EXPORTER_OTLP_ENDPOINT : http://jaeger:4318
ports :
- "5001:5001"
- "80:80"
- "443:443"
depends_on :
- redis
- postgres
- jaeger
volumes :
- ./blnk.json:/blnk.json
worker :
image : ${BLNK_IMAGE:-jerryenebeli/blnk:0.10.2}
container_name : worker
restart : on-failure
entrypoint : [ "blnk" , "workers" ]
environment :
OTEL_EXPORTER_OTLP_ENDPOINT : http://jaeger:4318
depends_on :
- redis
- postgres
- jaeger
volumes :
- ./blnk.json:/blnk.json
redis :
image : redis:7.2.4
container_name : redis
postgres :
image : ${POSTGRES_IMAGE:-postgres:16}
container_name : ${POSTGRES_CONTAINER:-postgres}
restart : on-failure
ports :
- "${POSTGRES_OUTER_PORT:-5432}:5432"
environment :
TZ : ${TZ:-Etc/UTC}
POSTGRES_USER : ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD : ${POSTGRES_PASSWORD:-password}
POSTGRES_DB : ${POSTGRES_DB:-blnk}
volumes :
- pg_data:/var/lib/postgresql/data
healthcheck :
test : [ "CMD" , "pg_isready" , "-U" , "${POSTGRES_USER:-postgres}" ]
interval : 10s
timeout : 5s
retries : 5
typesense :
image : typesense/typesense:0.23.1
container_name : typesense
command :
[ "--data-dir" , "/data" , "--api-key=blnk-api-key" , "--listen-port" , "8108" ]
volumes :
- typesense_data:/data
logging :
driver : "none"
healthcheck :
test : [ "CMD" , "curl" , "-f" , "http://localhost:8108/health" ]
interval : 30s
timeout : 10s
retries : 5
jaeger :
image : jaegertracing/all-in-one:latest
container_name : jaeger
ports :
- "16686:16686" # Jaeger UI
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
environment :
- COLLECTOR_OTLP_ENABLED=true
healthcheck :
test : [ "CMD" , "wget" , "--spider" , "http://localhost:16686" ]
interval : 10s
timeout : 5s
retries : 3
volumes :
pg_data :
typesense_data :
See all 94 lines
Start deployment Run the following docker commands:
# Initialize services
docker-compose up -d
# Execute database migration
docker-compose run --rm migration
# Verify deployment status
docker-compose ps
# Monitor service logs
docker-compose logs -f
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: Blnk Kubernetes Manifests
Prerequisites Ensure you have the following available or installed:
Kubernetes cluster 1.22+
kubectl configured
Helm 3.x installed
Managed database services (recommended)
Base configuration Create the namespace and configuration:
apiVersion : v1
kind : Namespace
metadata :
name : blnk
apiVersion : v1
kind : ConfigMap
metadata :
name : blnk-config
namespace : blnk
data :
blnk.json : |
{
"project_name": "Blnk",
"data_source": {
"dns": "postgres://<user>:<password>@<host>:5432/blnk?sslmode=require"
},
"redis": {
"dns": "redis://:<password>@<host>:6379"
},
"server": {
"port": "5001"
},
"queue": {
"monitoring_port": "5004"
}
}
Server deployment apiVersion : apps/v1
kind : Deployment
metadata :
name : blnk-server
namespace : blnk
spec :
replicas : 2
selector :
matchLabels :
app : blnk-server
template :
metadata :
labels :
app : blnk-server
spec :
containers :
- name : server
image : jerryenebeli/blnk:0.10.3
resources :
requests :
memory : "512Mi"
cpu : "250m"
limits :
memory : "1Gi"
cpu : "500m"
ports :
- containerPort : 5001
volumeMounts :
- name : config
mountPath : /blnk.json
subPath : blnk.json
livenessProbe :
httpGet :
path : /health
port : 5001
initialDelaySeconds : 30
periodSeconds : 10
volumes :
- name : config
configMap :
name : blnk-config
Worker deployment apiVersion : apps/v1
kind : Deployment
metadata :
name : blnk-worker
namespace : blnk
spec :
replicas : 2
template :
metadata :
labels :
app : blnk-worker
spec :
containers :
- name : worker
image : jerryenebeli/blnk:0.10.3
command : [ "blnk" , "workers" ]
resources :
requests :
memory : "512Mi"
cpu : "250m"
limits :
memory : "1Gi"
cpu : "500m"
volumeMounts :
- name : config
mountPath : /blnk.json
subPath : blnk.json
``` </Step>
<Step title="Migration job">
``` yaml migration-job.yaml
apiVersion : batch/v1
kind : Job
metadata :
name : blnk-migration
namespace : blnk
spec :
template :
spec :
containers :
- name : migration
image : jerryenebeli/blnk:0.7.4
command : [ "blnk" , "migrate" , "up" ]
volumeMounts :
- name : config
mountPath : /blnk.json
subPath : blnk.json
restartPolicy : Never
backoffLimit : 4
Start deployment process Run the following commands:
# Apply configurations
kubectl apply -f namespace.yaml
kubectl apply -f config.yaml
kubectl apply -f server.yaml
kubectl apply -f worker.yaml
# Execute migrations
kubectl apply -f migration-job.yaml
# Monitor deployment
kubectl get pods -n blnk
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
or kubectl logs
)
Review system logs
Monitor error tracking systems
Performance Issues
Review resource utilization
Check database performance
Monitor network latency
Additional Support
Technical documentation
Community forums
Support channels
Need help?
We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool.
To ask questions or discuss issues, please contact us or join our Discord community .
Responses are generated using AI and may contain mistakes.