MAINROUTE Cloud Migrations
Enterprise Infrastructure Transformation
Overview
As CTO at MAINROUTE, I led technical strategy and infrastructure modernization for enterprise clients across multiple Brazilian states. Over 10 years, I directed five major cloud migration projects, ranging from on-premises VMware to AWS/Azure, cloud-to-cloud transitions, and critical ERP database conversions - all with minimal downtime and measurable cost savings.
The Challenge: Enterprise Migrations at Scale
Enterprise infrastructure migrations are high-risk, high-impact projects that can't fail:
- Zero tolerance for data loss: Financial and ERP systems require perfect data integrity
- Minimal downtime requirements: 24/7 operations mean migration windows measured in hours, not days
- Legacy system complexity: 10+ year old applications with undocumented dependencies
- Compliance requirements: LGPD (Brazilian GDPR) and financial industry regulations
- Cost constraints: Must demonstrate ROI within 18-24 months
Migration Projects Delivered
Project 1: Portocred S/A - SQL Server Migration to Azure
Context: Financial institution with 500GB SQL Server database running on aging on-prem hardware
Approach:
- Assessed current SQL Server environment: identified missing indexes, deprecated configurations, performance bottlenecks
- Designed SQL Server AlwaysOn Availability Group architecture for high availability
- Chose Azure SQL Managed Instance over VM-based SQL Server for reduced operational overhead
- Implemented Database Migration Service (DMS) for minimal-downtime cutover
- Created rollback procedures and tested failover scenarios
Result: 99.95% uptime achieved. 40% reduction in database hosting costs. 24x7 DBA support delivered with documented failover procedures.
Project 2: Retail Client - On-Prem to AWS Migration
Context: Multi-location retail operation with VMware infrastructure and MySQL databases
Technical Decisions:
- MySQL Strategy: AWS RDS Multi-AZ instead of self-managed EC2 - trade automated backups/patching for slightly higher cost
- Application Servers: Kubernetes (EKS) for containerized workloads to enable auto-scaling
- Network Design: VPN + Direct Connect hybrid for gradual migration without cutting over all systems at once
- IaC: Terraform modules for reproducible infrastructure across dev, staging, production
Performance Optimization:
- Identified I/O bottlenecks through CloudWatch and MySQL slow query logs
- Recommended RDS instance type changes (memory-optimized instances for better buffer pool hit ratio)
- Implemented ElastiCache (Redis) for session storage to reduce database load
Result: Peak-load database stability improved by 60%. Auto-scaling enabled handling of Black Friday traffic without over-provisioning year-round.
Project 3: Cloud-to-Cloud Migration (Azure → AWS)
Context: Client needed to consolidate from Azure to AWS due to vendor standardization
Challenges:
- Azure-specific services (App Service, Cosmos DB) had no 1:1 AWS equivalents
- Active-active architecture required both clouds operational during transition
- DNS cutover had to be instantaneous to avoid downtime
Solution:
- Mapped Azure services to AWS equivalents: App Service → ECS Fargate, Cosmos DB → DynamoDB
- Implemented database replication (Azure Cosmos → DynamoDB) using custom Python sync scripts
- Blue-green deployment strategy: ran both clouds in parallel, gradual traffic shift via Route 53 weighted routing
Result: Zero-downtime migration. Decommissioned Azure resources after 30-day validation period.
Key Technical Decisions & Trade-offs
Managed Services vs Self-Managed
Decision Framework:
- Choose Managed (RDS, Managed Instance): When operational overhead (patching, backups, HA) outweighs cost difference
- Choose Self-Managed (EC2 + PostgreSQL): When specialized configurations (custom extensions, kernel tuning) are required
- Result: 70% of migrations used managed services - freed client IT teams to focus on application development instead of database operations
Migration Strategy: Big Bang vs Gradual
Lessons Learned:
- Big Bang (single cutover weekend): Only for smaller systems (< 100GB databases, < 5 applications). Higher risk but faster ROI.
- Gradual (hybrid cloud period): Essential for mission-critical systems. More expensive (running two clouds), but de-risks migrations.
- Implemented: Hybrid approach 80% of the time - non-critical workloads first, then databases, then frontend applications.
DevOps & Automation
- Infrastructure as Code: Terraform for AWS/Azure resource provisioning. Version-controlled infrastructure changes in Git for audit trail and rollback capability.
- CI/CD Pipelines: GitHub Actions + Jenkins for automated testing and deployment. Database migration scripts tested in staging before production cutover.
- Automation Scripts: Python scripts for database performance assessments, resource right-sizing recommendations, and cost analysis. Reduced manual assessment time from weeks to days.
- Monitoring: Zabbix + CloudWatch for unified monitoring across on-prem and cloud. Telegram alerts for infrastructure issues with automated ticket creation in service desk.
Cost Optimization Achievements
Technical Stack Across Projects
Risk Management & Governance
- Pre-Migration Assessments: Comprehensive discovery of all dependencies, database sizes, network bandwidth requirements. Documented in technical design specifications.
- Rollback Plans: Every migration had tested rollback procedures. Database snapshots taken immediately before cutover. DNS TTLs reduced to 60s for fast reversion.
- Stakeholder Communication: Weekly status reports to C-level executives. Migration runbooks shared with client IT teams. Post-migration knowledge transfer sessions.
- Compliance: LGPD compliance validated through data residency requirements (Brazil region). Security group rules, encryption at rest, and audit logging implemented per financial industry standards.
Lessons Learned
- Discovery Phase is Critical: 90% of migration issues stem from incomplete discovery. Invest 2-3 weeks mapping all dependencies - saves months of troubleshooting later.
- Test Rollback Procedures: Don't assume backups work. Actually test restoring from backup in a non-production environment before migration day.
- Gradual Beats Big Bang: Hybrid cloud periods are expensive but worth it. Can validate one workload at a time instead of betting entire business on a single cutover weekend.
- Cost Optimization is Ongoing: Right-sizing analysis every quarter revealed 15-20% additional savings after initial migration. Overprovisioning is common early on.