Overview
This guide helps you migrate from other analytical solutions to Duckling. Whether you’re coming from MariaDB ColumnStore, ClickHouse, or custom replication scripts, Duckling offers a simpler, more cost-effective alternative.Why Migrate to Duckling?
vs MariaDB ColumnStore
Duckling wins on:- Cost: 500+/month (no 128GB RAM requirement)
- Simplicity: Single DuckDB file vs complex ColumnStore cluster
- Correctness: Handles empty strings correctly (ColumnStore has bugs)
- Deployment: Docker Compose vs multi-server setup
- You have 100TB+ of data
- You need distributed queries across multiple nodes
- You have dedicated ops team
For most teams with < 10TB of data, Duckling provides better price/performance.
vs ClickHouse
Duckling wins on:- Simplicity: No ZooKeeper, no cluster management
- ACID: Real transactions, not eventual consistency
- JOINs: No JOIN limits or special syntax
- Operations: Single server, no ops overhead
- You’re ingesting 100K+ rows/sec continuously
- You have 10B+ row tables
- You have dedicated database ops team
- You need distributed queries
ClickHouse is powerful but operationally complex. Use Duckling unless you truly need ClickHouse’s scale.
vs Custom MySQL Read Replicas
Duckling wins on:- Query Performance: 100-13,000x faster analytical queries
- Storage: Columnar compression saves 60-90% disk space
- Replication: Automatic schema detection, watermark-based incremental sync
- Maintenance: Zero manual intervention with automation features
- You need transactional consistency (real-time reads)
- You need to support MySQL-specific features (stored procedures, triggers)
Migration Strategies
Strategy 1: Parallel Testing (Recommended)
Run Duckling alongside your existing solution to validate performance and correctness.Step 1: Deploy Duckling
Step 2: Configure MySQL Connection
Step 3: Initial Full Sync
Initial sync time: Expect ~60,000 rows/sec with the Appender API. A 10M row table takes ~3 minutes.
Step 4: Run Comparison Queries
Execute the same queries on both systems:- Query results (should match)
- Query latency
- Resource usage
Step 5: Validate Data Integrity
Step 6: Test Incremental Sync
Step 7: Benchmark Performance
Run your actual analytical workload:Step 8: Gradual Cutover
Once validated:- Week 1: Point non-critical dashboards to Duckling
- Week 2: Migrate more dashboards, monitor closely
- Week 3: Migrate critical reports
- Week 4: Decommission old solution
Strategy 2: Direct Migration
Replace existing solution immediately (higher risk).Prerequisites
Step 1: Backup Current System
Step 2: Deploy Duckling
Step 3: Full Sync
Step 4: Update Applications
Update application connection strings: Before (ClickHouse):Step 5: Verify and Monitor
Step 6: Decommission Old System
After 1-2 weeks of stable operation:Query Translation Guide
ClickHouse to Duckling
Date functions:MariaDB ColumnStore to Duckling
Most MySQL queries work as-is. Key differences: LIMIT with OFFSET:MySQL Read Replica to Duckling
Most MySQL analytical queries work unchanged in Duckling (DuckDB supports MySQL dialect).
- Stored procedures: Not supported (move logic to application)
- Triggers: Not replicated
- Foreign keys: Not enforced
- MySQL-specific functions: May need translation
Data Migration Checklist
Pre-Migration
Pre-Migration
- Audit current analytical queries
- Identify tables to replicate
- Check for unsupported types (spatial, etc.)
- Estimate initial sync time
- Plan for multi-database setup if needed
- Configure S3 backups for production
- Set up monitoring/alerting
During Migration
During Migration
- Deploy Duckling
- Configure MySQL connection
- Trigger full sync
- Validate row counts
- Test critical queries
- Enable incremental sync
- Monitor sync logs
- Update application connection strings
Post-Migration
Post-Migration
- Monitor query performance
- Set up automation (backups, cleanup)
- Document new architecture
- Train team on Duckling dashboard
- Decommission old solution
- Archive old backups
Rollback Procedure
If migration fails:Step 1: Stop Duckling
Step 2: Revert Application Changes
Revert connection strings to old solution.Step 3: Restart Old System
Step 4: Verify Service
Step 5: Post-Mortem
Document what went wrong:- Query incompatibilities?
- Performance issues?
- Data integrity problems?
- Configuration errors?
Multi-Database Migration
Migrating multiple databases:Option 1: Sequential Migration
Migrate one database at a time:Option 2: Parallel Migration
Migrate all databases simultaneously:Each database syncs independently with isolated connection pools.
Production Deployment Tips
Resource Planning
CPU: 4-8 cores recommended- 1 core for DuckDB queries
- 2-4 cores for worker threads (row sanitization)
- 1-2 cores for sync orchestration
- DuckDB uses ~2-4 GB for caching
- Worker threads: ~1 GB per thread
- MySQL connection pool: ~500 MB
- 2-5x the size of MySQL database (for DuckDB + backups)
- Example: 100 GB MySQL → 200-500 GB disk
High Availability
Option 1: Backup + Restore
Option 1: Backup + Restore
Use S3 backups for disaster recovery:Recovery Time: Download from S3 (~5 min for 100 GB)
Option 2: Active-Passive
Option 2: Active-Passive
Run two Duckling instances:
- Primary: Handles all queries and sync
- Secondary: Standby, periodic sync from MySQL
- Promote secondary to primary
- Update DNS/load balancer
- Restart sync on new primary
Security
Related Topics
- Type Support - Verify type compatibility
- Schema Evolution - Handle schema changes
- Common Issues - Troubleshoot migration problems
- Debugging - Debug migration issues