Created foundation for predictive maintenance analytics
Saved 3-4 hours weekly in manual error resolution
Original System Credit
Original architecture by Walter Quesada (CTO, Talisman) - provided solid foundation that served production needs 2019-2024. My work built upon his codebase, preserving core business logic while addressing architectural limitations that emerged as business scaled.
‣
Detailed Analysis
Document Date: August 20, 2025
Current Production State: NEW AWS Account (557477747490)
Document Purpose: Comprehensive comparison of architectures between old and current production systems
Executive Summary
This document provides a detailed architectural comparison between the original AWS implementation (Account: 183870809643) and the current production system (Account: 557477747490). The migration represents a fundamental shift from a transient data synchronization bridge to a persistent data warehouse architecture with enhanced reliability, monitoring, and control.
Key Transformation
FROM: Temporary sync bridge with DynamoDB caching
TO: Persistent data warehouse with Supabase PostgreSQL
STATUS: Successfully migrated and operational as of August 20, 2025
1. Infrastructure Comparison
OLD AWS (Account: 183870809643) - DECOMMISSIONED
Component
Specification
Notes
AWS Account
183870809643
Original implementation
Layer Version
GreenLightCore:44
Basic functionality
Layer Size
~45MB
Included AWS SDK v2
Runtime
nodejs18.x
Older runtime
Database
DynamoDB
Temporary storage only
Data Persistence
None
Deleted after each sync
Deployment Method
Manual
No CI/CD pipeline
Monitoring
Basic CloudWatch
Limited visibility
Error Recovery
Minimal
Manual intervention required
NEW AWS (Account: 557477747490) - CURRENT PRODUCTION
Component
Specification
Notes
AWS Account
557477747490
Current production
Layer Version
GreenLightCore:126
Enhanced with fixes
Layer Size
109MB
Includes deduplication service
Lambda Version
166 (live alias)
Latest with all fixes
Runtime
nodejs20.x
Latest LTS runtime
Database
Supabase PostgreSQL
Persistent storage
Data Persistence
Full historical
Kimball dimensional model
Deployment Method
SAM CLI
Infrastructure as code
Monitoring
Enhanced CloudWatch + Supabase
Full visibility
Error Recovery
Automated
Self-healing capabilities
2. Core Architecture Evolution
OLD Architecture - Transient Sync Bridge
Characteristics:
- Direct, always-on synchronization
- No data retention between syncs
- No historical tracking
- Limited error recovery
- No duplicate detection
- Simple status mapping
NEW Architecture - Persistent Data Warehouse
Characteristics:
- Persistent data storage
- Full historical tracking
- Advanced duplicate detection
- Configurable sync behavior
- Comprehensive error recovery
- Complex status mapping with validation
3. Lambda Functions Comparison
Function Architecture Evolution
Function
OLD AWS
NEW AWS
Key Changes
WebTrigger
Basic orchestration
Enhanced with safety checks
Added DynamoDB bypass, sync state validation
WorkOrders
Simple sync
Complex with deduplication
Added unit routing, status validation, PW verification
Key Improvements:
- Message-driven architecture
- Parallel processing capability
- State preservation between steps
- Automatic retry with exponential backoff
- Dead letter queue for failed messages
Advantages:
- Full historical tracking (SCD Type 2)
- Analytics and reporting ready
- Complete audit trail
- Data recovery capability
- Real-time monitoring
6. Configuration & Feature Management
OLD: Hard-Coded Configuration
// No configuration managementconst SYNC_ENABLED = true; // Always onconst SF_ENABLED = true; // No controlconst DEBUG = false; // No visibility
NEW: Environment-Based Feature Flags
Control Capabilities:
- Toggle ServiceFusion sync without deployment
- Dry-run mode for testing
- Safe mode for production protection
- Granular status control
- Real-time configuration updates
Problem: Lambda used cached old code after deployment
Solution: Force cold start with version publishing
# Required after every deployment./restore-env-and-publish.sh
Result: Guaranteed fresh code execution
9. Performance Metrics Comparison
OLD AWS Performance
Metric
Value
Notes
Sync Duration
?
Sequential processing
Memory Usage
512MB limit
Frequent OOM errors
Error Rate
15-20%
Connection issues
Data Loss
Common
No persistence
Recovery Time
Hours
Manual intervention
NEW AWS Performance (Current Production)
Metric
Value
Notes
Sync Duration
10 minutes
Parallel processing
Memory Usage
216MB / 1024MB
Ample headroom
Error Rate
<1%
Self-healing
Data Loss
None
Full persistence
Recovery Time
Automatic
Self-recovery
10. Monitoring & Observability
OLD: Basic CloudWatch
Lambda execution logs only
No custom metrics
No alerting
Limited debugging capability
NEW: Comprehensive Monitoring
CloudWatch Metrics:
- Custom metrics for each sync phase
- Error categorization and tracking
- Performance metrics per handler
- API call success rates
Supabase Monitoring:
- Real-time data validation
- Row count monitoring
- Duplicate detection alerts
- Data quality metrics
The migration from OLD AWS to NEW AWS represents a complete architectural transformation from a simple synchronization bridge to a comprehensive data warehouse solution. The current production system (v166 with layer v126) incorporates numerous fixes, enhancements, and architectural improvements that provide:
Reliability: <1% error rate vs 15-20% previously
Control: Feature flags and dry-run capability
Persistence: Full historical data retention
Monitoring: Comprehensive observability
Scalability: Parallel processing architecture
The system is currently in stable production with ServiceFusion enabled, processing work orders successfully with all critical fixes applied through August 20, 2025.
Document Generated: August 20, 2025
Based on Production State: Lambda v166, Layer v126
Account: 557477747490 (NEW AWS)
More about me
My aim is to live a balanced and meaningful life, where all areas of my life are in harmony. By living this way, I can be the best version of myself and make a positive difference in the world. About me →
// Current Production Configuration (as of Aug 20, 2025){
"DRY_RUN": "false", // Production mode active "ENABLE_SERVICE_FUSION": "true", // SF sync enabled "SAFE_MODE": "true", // Extra validation active "FEATURE_FLAG_PW_WO_VERIFY_STRICT": "false", // Flexible validation "FEATURE_PW_OPEN_STATUSES": "open,partially completed,awaiting parts,...", "SNSTOPIC": "arn:aws:sns:us-east-1:557477747490:GreenLightSNSTopic", "SUPABASE_URL": "https://gvdslkuqiezmkombppqe.supabase.co"}
try {
// Sync operation with validation} catch (error) {
// Categorized error handling if (error.code === 'ECONNRESET') {
// PropertyWare connection fix await pw.reconnect({ keepAlive: false }); // Retry with exponential backoff } else if (error.status === 422) {
// ServiceFusion validation error await handleValidationError(error); // Log to error_logs table } else if (error.message.includes('duplicate')) {
// Duplicate detection await deduplication.handleDuplicate(entity); // Skip and continue }
// Store error for analysis await supabase.from('error_logs').insert({
timestamp: new Date(), function: context.functionName, error: error.message, stack: error.stack, recovery_action: recoveryAction
});}