Healthcare SaaS Legacy Modernization

Complete cloud modernization of medical equipment planning platform, migrating from single EC2 monolith to containerized serverless architecture.

4-Tower Platform Modernization

Project Overview

4-Tower LLC, provider of SpecAdvisor—a leading medical equipment planning and procurement software for healthcare facilities—approached us with a critical challenge: their decade-old application was running on outdated infrastructure that couldn’t scale to meet growing demand. We executed a complete legacy modernization, transforming a fragile monolith into a robust, containerized, serverless cloud architecture.

The Challenge

The Legacy State

  • Single EC2 Instance: Entire application running on one t2.large instance
  • Outdated PHP: PHP 5.6 (end-of-life, security vulnerabilities)
  • Legacy CRM: Old SugarCRM installation with custom modifications
  • Monolithic MySQL: Single database instance, no backups, no failover
  • No Environments: Development done directly on production
  • Manual Deployments: SSH and FTP-based deployments
  • Angular 1.x: Outdated frontend framework
  • No Monitoring: Zero visibility into system health
  • Security Risks: No WAF, hardcoded credentials, no encryption at rest

Business Impact of Legacy Stack

  • Frequent downtime affecting healthcare facility operations
  • Unable to onboard new customers due to capacity constraints
  • Security audit failures preventing enterprise contracts
  • Technical debt blocking feature development
  • Developer frustration with brittle codebase
Legacy Architecture

Our Solution

Phased Modernization Strategy

We implemented a zero-downtime migration using the strangler fig pattern, progressively modernizing components while maintaining service continuity.

Modern Cloud Architecture

Containerization

  • Dockerized PHP application with multi-stage builds
  • ECS Fargate for container orchestration
  • Blue-green deployment strategy
  • Auto-scaling based on CPU and memory metrics

Database Modernization

  • Migrated MySQL to RDS Aurora Serverless v2
  • Automated daily backups with 30-day retention
  • Multi-AZ deployment for high availability
  • Read replicas for reporting workloads
  • Database encryption at rest and in transit

Frontend Optimization

  • Angular application modernization
  • Static assets moved to S3
  • CloudFront CDN for global distribution
  • Gzip and Brotli compression
  • Lazy loading and code splitting

Serverless Backend

  • AWS Lambda for background tasks
  • API Gateway for RESTful endpoints
  • EventBridge for scheduled jobs
  • SQS for asynchronous processing
  • Step Functions for complex workflows

Authentication & Security

  • AWS Cognito for user management
  • MFA support for admin users
  • SSO integration for enterprise customers
  • WAF with managed rule sets
  • Secrets Manager for credential rotation

Storage & Assets

  • S3 for document storage
  • S3 Lifecycle policies for archival
  • CloudFront signed URLs for secure access
  • Medical equipment spec sheets and drawings
  • Project documentation and reports
Modernized Architecture

Technology Stack

Application Layer

  • Backend: PHP 8.2 with Composer
  • Framework: Laravel 10.x (migrated from custom PHP)
  • Frontend: Angular 15 with TypeScript
  • API: RESTful with OpenAPI documentation

AWS Infrastructure

  • Compute: ECS Fargate, Lambda (Node.js runtime)
  • Database: RDS Aurora Serverless v2 (MySQL compatible)
  • Storage: S3 Standard/Intelligent-Tiering
  • CDN: CloudFront with custom SSL
  • Authentication: Cognito User Pools
  • API: API Gateway HTTP APIs
  • Orchestration: Step Functions
  • Messaging: SQS, SNS, EventBridge
  • Monitoring: CloudWatch, X-Ray
  • Security: WAF, Secrets Manager, GuardDuty

DevOps & CI/CD

  • Version Control: GitHub with branch protection
  • CI/CD: GitHub Actions
  • Containers: Docker, ECR
  • Infrastructure: Terraform
  • Monitoring: New Relic, CloudWatch Dashboards
  • Logging: CloudWatch Logs with retention policies

Development Environments

  • Development: Isolated ECS cluster, RDS snapshot
  • QA/Staging: Production-like environment for testing
  • Production: Multi-AZ, auto-scaling, blue-green deployments
CI/CD Pipeline

Development Process

Phase 1: Assessment & Planning (3 weeks)

  • Complete infrastructure audit
  • Dependency mapping
  • Security vulnerability assessment
  • Database schema analysis
  • Customer usage pattern analysis
  • Modernization roadmap creation

Phase 2: Foundation (6 weeks)

  • Set up DEV/QA/PROD environments
  • Migrate version control to Git
  • Establish CI/CD pipelines
  • Dockerize application
  • Create RDS test instance
  • Implement monitoring baselines

Phase 3: PHP Upgrade (8 weeks)

  • PHP 5.6 → 7.4 compatibility fixes
  • PHP 7.4 → 8.0 migration
  • PHP 8.0 → 8.2 optimization
  • Legacy code refactoring
  • Deprecation warnings resolution
  • Performance testing at each step

Phase 4: Database Migration (6 weeks)

  • Schema optimization
  • Create RDS Aurora cluster
  • Data migration scripts
  • Sync mechanisms for parallel run
  • Cutover planning and execution
  • Rollback procedures testing

Phase 5: Containerization (8 weeks)

  • Multi-stage Dockerfile creation
  • ECS task definitions
  • Load balancer configuration
  • Auto-scaling policies
  • Blue-green deployment setup
  • Container health checks

Phase 6: Frontend Modernization (10 weeks)

  • Angular 1.x → Angular 15 migration
  • TypeScript integration
  • Component architecture redesign
  • State management with RxJS
  • S3 + CloudFront deployment
  • Progressive Web App features

Phase 7: Serverless Integration (6 weeks)

  • Lambda functions for background jobs
  • API Gateway endpoints
  • Event-driven architecture
  • Workflow automation with Step Functions
  • Email notifications via SES
  • Report generation optimization

Phase 8: Security Hardening (4 weeks)

  • Cognito user pool creation
  • User migration from legacy auth
  • WAF rule implementation
  • Secrets Manager integration
  • Encryption at rest enablement
  • Security audit and penetration testing

Phase 9: Monitoring & Optimization (3 weeks)

  • CloudWatch dashboard creation
  • Alert configuration
  • Performance tuning
  • Cost optimization
  • Documentation
  • Team training

Key Features Implemented

Multi-Environment Strategy

  • Development: Rapid iteration, developer sandboxes
  • QA: Automated testing, staging for client demos
  • Production: HA, auto-scaling, blue-green deployments
  • DR: Cross-region RDS snapshots, S3 replication

Automated Backup & Recovery

  • Automated RDS snapshots every 6 hours
  • Point-in-time recovery up to 35 days
  • S3 versioning for documents
  • Disaster recovery runbook
  • Quarterly DR drills

Authentication System

  • Cognito-based user management
  • Role-based access control (RBAC)
  • MFA for administrators
  • SSO for enterprise customers
  • Password policies enforcement
  • Session management

Performance Optimization

  • ECS task auto-scaling (2-20 tasks)
  • RDS Aurora auto-scaling (0.5-16 ACUs)
  • CloudFront edge caching
  • Database query optimization
  • API response caching with ElastiCache
  • Lazy loading for large datasets

Monitoring & Observability

  • Real-time CloudWatch dashboards
  • Application performance monitoring (New Relic)
  • Distributed tracing with X-Ray
  • Log aggregation and analysis
  • PagerDuty integration for incidents
  • Weekly SRE review meetings
Monitoring Dashboard

Results & Impact

Performance Improvements

  • Uptime: From 94% to 99.95% (60% reduction in downtime)
  • Response Time: API latency reduced from 2.5s to 180ms (93% faster)
  • Page Load: Frontend load time from 8s to 1.2s (85% improvement)
  • Scalability: From 100 to 5,000+ concurrent users
  • Deployment Time: From 4 hours to 12 minutes

Cost Optimization

  • Infrastructure Costs: 35% reduction despite increased capacity
  • RDS Serverless: Only pay for actual usage
  • ECS Fargate: No idle EC2 instances
  • S3 Lifecycle: Automatic archival saving 40% on storage
  • Lambda: Pay-per-invocation model
  • Reserved Instances: Strategic use for predictable workloads

Business Impact

  • New Customers: Onboarded 45 new healthcare facilities in 6 months
  • Enterprise Deals: Closed 3 major contracts requiring security compliance
  • Feature Velocity: Development speed increased 3x
  • Customer Satisfaction: NPS score improved from 42 to 78
  • Technical Debt: Reduced by 70%
  • Developer Retention: Zero turnover post-modernization

Security & Compliance

  • HIPAA Readiness: Architecture aligned with HIPAA requirements
  • SOC 2: Passed audit on first attempt
  • Zero Breaches: No security incidents post-migration
  • Encryption: 100% of data encrypted at rest and in transit
  • Access Controls: Fine-grained IAM policies
  • Audit Trails: Complete CloudTrail logging

Operational Excellence

  • Zero-Downtime Deployments: Blue-green strategy eliminates outages
  • Automated Rollbacks: Failed deployments auto-revert in < 2 minutes
  • Infrastructure as Code: 100% of infrastructure in Terraform
  • Documentation: Comprehensive runbooks and architecture diagrams
  • Team Confidence: Developers empowered to deploy daily
Performance Analytics

Technical Deep Dive

PHP 5 → PHP 8 Migration Strategy

The PHP upgrade was the most challenging aspect, requiring careful planning:

Compatibility Analysis

  • Automated scanning with PHPCompatibility
  • Manual code review for breaking changes
  • Third-party dependency updates
  • Custom SugarCRM modifications rewriting

Step-by-Step Approach

  1. PHP 5.6 → 7.0: Removed deprecated functions
  2. PHP 7.0 → 7.4: Addressed type juggling changes
  3. PHP 7.4 → 8.0: Union types and named arguments
  4. PHP 8.0 → 8.2: JIT compiler optimization

Performance Gains

  • 60% faster execution time
  • 40% memory reduction
  • Better CPU utilization
  • Improved garbage collection

Containerization Best Practices

# Multi-stage build for optimized images
FROM php:8.2-fpm-alpine AS builder
# Build dependencies and Composer install
RUN apk add --no-cache git zip
COPY composer.json composer.lock ./
RUN composer install --no-dev --optimize-autoloader

FROM php:8.2-fpm-alpine
# Runtime dependencies only
COPY --from=builder /app/vendor ./vendor
# Healthcare-specific extensions
RUN docker-php-ext-install pdo_mysql opcache
# Security hardening
RUN adduser -D -u 1000 appuser
USER appuser

RDS Aurora Serverless Configuration

  • Min Capacity: 0.5 ACUs (idle periods)
  • Max Capacity: 16 ACUs (peak loads)
  • Auto-Pause: After 5 minutes of inactivity
  • Scale Points: Smart scaling during low-activity periods
  • Connection Pooling: RDS Proxy for Lambda connections

ECS Task Definition

{
  "cpu": "512",
  "memory": "1024",
  "requiresCompatibilities": ["FARGATE"],
  "networkMode": "awsvpc",
  "containerDefinitions": [{
    "name": "app",
    "image": "4tower/specadvisor:latest",
    "healthCheck": {
      "command": ["CMD-SHELL", "curl -f http://localhost/health || exit 1"],
      "interval": 30,
      "timeout": 5,
      "retries": 3
    }
  }]
}
Container Architecture

Migration Challenges & Solutions

Challenge 1: Zero-Downtime Migration

Problem: Healthcare facilities operate 24/7; downtime unacceptable

Solution:

  • Blue-green deployment strategy
  • Database replication with bidirectional sync
  • Feature flags for gradual rollout
  • Comprehensive rollback procedures

Challenge 2: Custom SugarCRM Modifications

Problem: Heavily customized CRM with undocumented changes

Solution:

  • Code archaeology to document customizations
  • Extracted to separate microservice
  • API-based integration
  • Gradual feature parity in new system

Challenge 3: Large Database Migration

Problem: 500GB database with complex relationships

Solution:

  • AWS Database Migration Service (DMS)
  • Continuous replication during transition
  • Data validation scripts
  • Phased cutover by customer segment

Challenge 4: Legacy Angular 1.x Frontend

Problem: Complete rewrite would take too long

Solution:

  • Hybrid approach using ngUpgrade
  • Component-by-component migration
  • Maintained feature parity throughout
  • TypeScript for new components

Challenge 5: Hardcoded Secrets

Problem: Database credentials and API keys in code

Solution:

  • Secrets Manager for all credentials
  • Automated rotation for RDS passwords
  • IAM roles instead of access keys
  • Audit of all hardcoded values
Security Architecture

Client Testimonial

“Greicodex took our decade-old application and transformed it into a modern, scalable platform. The migration was seamless—our customers didn’t experience a single minute of downtime. We can now confidently pursue enterprise contracts knowing our infrastructure meets the highest security standards. The investment has already paid for itself through new customer acquisition.”

— CTO, 4-Tower LLC

Technologies Used

  • Backend: PHP 8.2, Laravel 10.x
  • Frontend: Angular 15, TypeScript, RxJS
  • Containers: Docker, Amazon ECS Fargate, ECR
  • Database: Amazon RDS Aurora Serverless v2 (MySQL)
  • Serverless: AWS Lambda, API Gateway, Step Functions
  • Storage: S3, CloudFront CDN
  • Authentication: AWS Cognito
  • Monitoring: CloudWatch, New Relic, X-Ray
  • Security: WAF, Secrets Manager, GuardDuty
  • CI/CD: GitHub Actions, Terraform
  • Messaging: SQS, SNS, EventBridge

Lessons Learned

  1. Incremental Migration Wins: Strangler fig pattern reduced risk vs. big bang
  2. PHP Version Jumps: Skipping versions is dangerous; step-by-step is safer
  3. Container Sizing: Right-sizing saved 40% on compute costs
  4. RDS Serverless: Perfect for variable workloads in healthcare
  5. Documentation Matters: Legacy code archaeology was time-consuming
  6. Customer Communication: Weekly updates built trust during migration
  7. Feature Flags: Essential for risk-free deployments
  8. Monitoring First: Should have been implemented earlier in the process

Long-Term Benefits

Technical

  • Modern tech stack attracting top talent
  • Reduced technical debt enabling faster development
  • Infrastructure as Code for reproducible environments
  • Comprehensive test coverage (now at 78%)

Business

  • Competitive advantage in enterprise market
  • Reduced support burden from stability improvements
  • Faster time-to-market for new features
  • Foundation for mobile app development

Operational

  • Automated operations reducing manual toil
  • Improved developer experience and productivity
  • Clear upgrade path for future enhancements
  • Disaster recovery confidence

Want to Modernize Your Legacy Application?

We specialize in zero-downtime migrations of mission-critical healthcare applications. Our proven methodologies minimize risk while maximizing business value.

Schedule a Consultation | View More Projects

Ready to Get Started?

Let's discuss how we can help you achieve your goals.

Contact Us