Migrating from Cloud to On-premise Device Detection
This guide walks you through migrating from 51Degrees Cloud Device Detection to On-premise deployment. You'll learn when to migrate, how to update your configuration, and what changes to expect.
When to Consider On-premise
On-premise deployment works better when you need:
- Faster response times - Sub-microsecond detection with in-process deployment
- Data privacy - All processing happens within your infrastructure
- High-volume processing - Handle millions of detections without API limits
- Offline capability - No internet connection required
- Predictable costs - Fixed licensing instead of per-request pricing
Migration Steps Overview
- Get an On-premise license and data file
- Update package dependencies (if needed)
- Change pipeline configuration
- Modify code for file-based detection
- Set up data file updates
- Test and optimize performance
Step 1: Get License and Data File
For testing:
- Download the free Lite data file from GitHub
- No License Key required, but limited device properties
For production:
- Contact 51Degrees to purchase an Enterprise license
- Includes full data file with all device properties
- Automatic data file updates included
Step 2: Update Dependencies
Most 51Degrees packages already include both Cloud and On-premise capabilities. You typically only need configuration changes.
.NET
Java
Node.js
Other Languages
- C/C++: device-detection-cxx
- Go: device-detection-go
- PHP: device-detection-php-onpremise
- Python:
pip install fiftyone-devicedetection-onpremise
Step 3: Update Configuration
Replace your Cloud configuration with file-based settings.
Before (Cloud):
After (On-premise):
Step 4: Update Code
The Pipeline API keeps most code unchanged. Main differences:
Pipeline Creation
Before:
After:
Error Handling
- Handle file system errors instead of network errors
- Check data file permissions and disk space
- Monitor data file update failures
Property Access
- All properties are available locally (no Cloud restrictions)
- No rate limiting on property requests
- Consistent response times regardless of property count
For complete examples:
Step 5: Set Up Data File Updates
On-premise deployments need regular data file updates to detect new devices.
Automatic Updates (Recommended)
Configure the pipeline to handle updates. See the Data File Updates examples for comprehensive examples of:
- Update on Startup
- File System Watcher
- Polling Interval
Manual Updates
Download new data files from the 51Degrees Distributor using your License Key.
Step 6: Optimize Performance
Choose Performance Profile
- MaxPerformance - Fastest detection, uses more memory (recommended)
- HighPerformance - Good balance of speed and memory
- LowMemory - Slowest but minimal memory usage
- Balanced - Default middle ground
Deployment Options
- In-Process - Fastest option, detection in your application
- Out-of-Process - Separate process for isolation
- Separate Server - Centralized detection service
See Performance Examples for benchmarking.
Testing Your Migration
- Compare Results - Verify detection matches Cloud results for test cases
- Load Testing - Confirm performance under expected traffic
- Update Testing - Ensure data file updates work without disruption
- Failover Testing - Test what happens if data file becomes unavailable
Common Migration Patterns
Web Applications
- Use web integration examples
- Configure automatic request processing
- Add client-side evidence for better accuracy
Batch Processing
- Use offline processing
- Process large User-Agent lists efficiently
- Use multi-threading for maximum throughput
Microservices
- Deploy as sidecar container
- Share data file via volume mount
- Use environment variables for configuration
Planning Your Rollback
Keep Cloud access during migration:
- Maintain your Cloud Resource Key
- Use feature flags to switch between Cloud and On-premise
- Run both implementations in parallel initially
- Gradually shift traffic to On-premise
Troubleshooting
Data file not found
- Check file path is absolute and correct
- Verify file permissions allow read access
- Confirm data file downloaded successfully
License Key issues
- Ensure license is for On-premise (not Cloud)
- Check license hasn't expired
- Verify product tier matches your data file
Poor performance
- Confirm you're using MaxPerformance profile
- Check you're running in-process (not separate service)
- Review performance examples
Memory usage too high
- Switch to HighPerformance or LowMemory profile
- Consider out-of-process deployment
- Monitor memory usage patterns
Next Steps
- Review On-premise examples
- Set up automatic data file updates
- Enable client-side evidence for better accuracy
- Monitor match metrics for quality
💬 Get Help
- Enterprise support: support@51degrees.com
- Technical documentation: On-premise Guide
- Community support: GitHub Issues