Deployment
Deployment Guide#
Choose the deployment strategy that best fits your requirements.
Deployment Modes#
ncps supports two primary deployment modes:
Single-Instance Deployment#
One ncps server handling all cache requests.
Best for:
- Development and testing
- Small to medium teams (1-100+ users)
- Single-location deployments
- Simpler operations
Characteristics:
- One server
- Local locks (no Redis)
- Local or S3 storage
- SQLite, PostgreSQL, or MySQL database
- Easier to set up and maintain
High Availability Deployment#
Multiple ncps instances for redundancy and scalability.
Best for:
- Production environments
- Large teams (100+ users)
- Business-critical infrastructure
- Geographic distribution
- Zero-downtime requirements
Characteristics:
- 2+ servers
- Redis distributed locking
- S3 storage (required)
- PostgreSQL or MySQL database (required, NOT SQLite)
- Load balancer
- More complex setup
Quick Comparison#
| Aspect | Single-Instance | High Availability |
|---|---|---|
| Servers | 1 | 2+ |
| Locking | Local (in-process) | Redis distributed locks |
| Storage | Local or S3 | S3 (required) |
| Database | SQLite, PostgreSQL, or MySQL | PostgreSQL or MySQL (NOT SQLite) |
| Load Balancer | Not needed | Required |
| Redundancy | None | Full |
| Complexity | Simple | Moderate |
| Zero Downtime | No | Yes |
| Scalability | Limited to one server | Horizontal scaling |
| Cost | Lower | Higher |
Decision Tree#
Start
│
├─ Need zero-downtime updates? ──Yes──> High Availability
├─ Need geographic distribution? ──Yes──> High Availability
├─ Team > 100 users? ──Yes──> High Availability
├─ Mission-critical service? ──Yes──> High Availability
│
└─ Otherwise ──> Single-InstanceDocumentation#
- Single-Instance Deployment - Deploy one ncps server
- High Availability Deployment - Deploy multiple instances with HA
- Distributed Locking - Deep dive into Redis locking for HA
Prerequisites by Mode#
Single-Instance Prerequisites#
Minimum:
- Server or VM (2+ CPU cores, 4GB+ RAM recommended)
- Storage (50GB-1TB depending on usage)
- Network connectivity to upstream caches
Optional:
- S3-compatible storage (for cloud-native or future HA)
- PostgreSQL/MySQL (for better performance than SQLite)
High Availability Prerequisites#
Required:
- 2+ servers (3+ recommended for better availability)
- Redis server (single instance or cluster)
- S3-compatible storage (AWS S3, MinIO, etc.)
- PostgreSQL or MySQL database
- Load balancer (nginx, HAProxy, cloud LB)
Optional:
- Monitoring and alerting (Prometheus, Grafana)
- Centralized logging (ELK, Loki)
Getting Started#
- Choose deployment mode based on your requirements
- Review prerequisites for your chosen mode
- Follow installation guide:
- Configure according to your mode:
- Verify deployment and test
- Set up monitoring (recommended)
Migration Path#
From Single-Instance to HA#
Common migration path as your needs grow:
- Start: Single instance with local storage and SQLite
- Scale up: Move to PostgreSQL for better performance
- Cloud-ready: Migrate to S3 storage
- High Availability: Add Redis and additional instances
Each step is incremental and can be done independently.
See High Availability Guide for detailed migration steps.
Common Deployment Patterns#
Pattern 1: Development Setup#
Developer Workstation
└── ncps (Docker)
├── Local storage
└── SQLitePattern 2: Small Team#
Shared Server
└── ncps (systemd)
├── Local NFS storage
└── SQLite or PostgreSQLPattern 3: Cloud Production (Single)#
Cloud VM
└── ncps (Docker/Kubernetes)
├── S3 storage
└── Managed PostgreSQL (RDS, etc.)Pattern 4: High Availability#
Load Balancer
├── ncps Instance 1
├── ncps Instance 2
└── ncps Instance 3
├── Shared S3 storage
├── Shared PostgreSQL
└── Shared RedisNext Steps#
- Choose and follow deployment guide
- Configure clients to use your cache
- Set up monitoring for production
- Review operations guides for maintenance
Related Documentation#
- Installation Guides - Installation methods
- Configuration Reference - All configuration options
- Operations Guides - Monitoring, troubleshooting, backups