| name | stack-swap-simulator |
| description | Estimates cost and effort to switch from one tech stack to another |
Stack Swap Simulator Skill
Estimates cost and effort to switch from one tech stack to another. Helps answer: "Can we migrate later if needed?"
When to Use
Use this skill to understand:
- Cost of switching stacks โ engineer weeks + downtime risk
- Timeline to switch โ how long is the project?
- Risk of switching โ what can go wrong?
- ROI of switching โ does it save money long-term?
- Backwards compatibility โ can we do a gradual migration?
Input
Provide source and target stacks:
{
"from_stack": {
"backend": "Node.js",
"database": "MongoDB",
"deployment": "Vercel"
},
"to_stack": {
"backend": "Go",
"database": "PostgreSQL",
"deployment": "Kubernetes"
},
"codebase_size": 50000,
"monthly_revenue": 50000,
"max_downtime_hours": 4
}
Output
A migration impact report:
{
"from": "Node.js + MongoDB + Vercel",
"to": "Go + PostgreSQL + Kubernetes",
"feasibility": {
"effort_engineer_weeks": 8,
"cost_dollars": 50000,
"timeline_weeks": 10,
"downtime_hours": 4,
"risk_level": "high"
},
"cost_breakdown": {
"engineering_salaries": 40000,
"infrastructure_setup": 3000,
"testing_and_qa": 2000,
"consulting_fees": 5000
Migration Scenarios
Scenario 1: Easy Migration (Same database, swap backend framework)
Example: Node.js โ Go (both use PostgreSQL)
Effort: 2-3 engineer weeks
Cost: $10-15k
Downtime: 1-2 hours
Complexity: Low (database schema unchanged)
Steps:
- Build Go version of API (reuse same database)
- Run both systems pointing to same database
- Route traffic gradually (5% โ 25% โ 100% to Go)
- Retire Node.js once stable
Why easy: Database contract unchanged, can run both simultaneously
Scenario 2: Medium Migration (Swap backend AND database)
Example: Node.js + MongoDB โ Go + PostgreSQL
Effort: 6-8 engineer weeks
Cost: $40-50k
Downtime: 2-4 hours
Complexity: Medium (schema mapping needed)
Steps:
- Build PostgreSQL schema (map MongoDB documents โ tables)
- Implement data migration script (background job)
- Build Go API against PostgreSQL
- Run both systems for parallel testing (1-2 weeks)
- Final cutover (stop MongoDB writes, run Go only)
Why harder: Must map MongoDB doc structure โ PostgreSQL schema (not 1-to-1)
Scenario 3: Hard Migration (Swap backend, database, AND deployment)
Example: Node.js + MongoDB + Vercel โ Go + PostgreSQL + Kubernetes
Effort: 8-12 engineer weeks
Cost: $50-80k
Downtime: 4-8 hours
Complexity: High (infrastructure completely different)
Steps:
- Set up Kubernetes cluster (AWS EKS, GCP GKE, etc.)
- Build data migration pipeline (MongoDB โ PostgreSQL)
- Build Go API
- Set up Kubernetes deployments, monitoring, logging
- Test extensively (Kubernetes failure modes different)
- Cutover with careful monitoring
Why hard: Three different systems, all must work together correctly
Scenario 4: Impossible Migration (Too risky)
When NOT to migrate:
- System in active development (too much flux)
- No downtime tolerance (24/7 uptime required)
- Complex stateful logic in old system
- Small team (can't afford to stop feature development)
Example: Live multiplayer game (can't take 4 hours downtime)
Cost Analysis: When Does Migration Pay Off?
Formula:
migration_cost = engineering + infrastructure + consulting + opportunity_cost
annual_savings = current_cost - new_cost
payback_period_months = migration_cost / (annual_savings / 12)
worth_it = payback_period <= 18 months (typical 3-5 year horizon)
Example:
Current: Node.js + Vercel = $8k/month
New: Go + Kubernetes = $4k/month
Savings: $4k/month = $48k/year
Migration cost: $50k
Payback period: 50k / (48k/12) = 12.5 months โ
Worth it
Running payoff calculation:
Month 0: -$50k (migration)
Month 12: -$50k + (4k ร 12) = -$2k (still not paid back)
Month 13: -$50k + (4k ร 13) = +$2k โ
(now profitable)
Risk Assessment
Data Loss Risk
High risk (10-20%):
- Complex data transformations (high chance of bug)
- No test environment matching production
- One-shot migration (can't rollback)
Medium risk (3-5%):
- Simple schema mapping (low chance of bug)
- Good test environment
- Parallel running period (can verify data)
Low risk (<2%):
- Straight replication (MongoDB โ JSON in PostgreSQL)
- Extensive testing
- Easy rollback plan
Mitigation: Run both systems simultaneously for 1-2 weeks, verify data matches exactly
Downtime Risk
Factors:
- Can you run both systems in parallel? (Reduces downtime)
- How complex is data cutover? (Simple = fast, complex = slow)
- Have you tested the cutover process? (Untested = risky)
Typical downtime estimates:
Simple backend swap: 1 hour
Backend + database: 2-4 hours
Everything including infra: 4-8 hours
Mitigation:
- Cutover during low-traffic window (3am Sunday)
- Have rollback plan ready (can revert to old system)
- On-call engineer present during cutover
- Comprehensive monitoring alerts
Budget Overrun Risk
Common reasons for overruns:
- Data transformation more complex than expected (+20%)
- Kubernetes learning curve for team (+30%)
- Production issues discovered during testing (+25%)
- Scope creep (migrations attract "while we're at it" requests) (+50%)
Strategies to control:
- Fixed-scope contract (define exact features to migrate)
- Weekly cost reviews (catch overruns early)
- Dedicated project manager (enforces timeline)
- Allocate 20% buffer (scope creep reserve)
Timeline Overrun Risk
Most migrations take 20-50% longer than estimated:
- Reason 1: Underestimating test time (always takes longer)
- Reason 2: Unforeseen data issues (real data messier than expected)
- Reason 3: Team knowledge gaps (learning curve adds weeks)
Realistic timeline:
- Optimistic estimate: 8 weeks
- Realistic estimate: 8 ร 1.3 = 10-11 weeks
- Pessimistic estimate: 8 ร 1.5 = 12-13 weeks
Buffer to build in: 2-3 weeks (20-30%)
Gradual Migration vs. Big Bang
Big Bang Migration
One day, flip switch from old to new system
Pros:
- โ
Clean break (one dramatic moment, then done)
- โ
Easy to understand timeline
- โ
Forces team commitment
Cons:
- โ High risk (if something breaks, users affected immediately)
- โ Hard to rollback (both systems running for month = expensive)
- โ All eggs in one basket
Risk level: High
Gradual Migration
Start routing percentage of traffic to new system, increase over time
Pros:
- โ
Lower risk (catch issues on 5% traffic before 100%)
- โ
Easy to rollback (keep old system, just reduce traffic)
- โ
Real-world testing (production traffic reveals issues labs miss)
Cons:
- โ Run both systems longer (more expensive)
- โ Complex to coordinate (feature parity needed)
- โ Longer timeline (more weeks of dual operation)
Risk level: Medium
Decision Tree: Should We Migrate?
1. Is the migration forced?
a) Yes (old tech no longer supported): DO IT
b) No (voluntary): go to step 2
2. How much will we save annually?
a) <$10k/year: Don't migrate (not worth effort)
b) $10-50k/year: Marginal (do if team capacity allows)
c) $50k+/year: Worth investigating
3. What's the payback period?
a) <12 months: โ
DO IT (quick ROI)
b) 12-24 months: โ ๏ธ MAYBE (reasonable if business stable)
c) >24 months: โ DON'T (too long to justify)
4. Do we have team capacity?
a) Dedicated team (can pause feature work): โ
Good
b) Shared capacity (features paused 2 months): โ ๏ธ Okay
c) No capacity (features continue): โ Too risky
5. Can we do gradual migration?
a) Yes (architecture supports parallel): โ
Much safer
b) No (big bang required): โ ๏ธ Higher risk
โ Decision:
Forced migration OR (savings > $50k AND payback < 18 months AND team capacity available)
โ DO IT
Anything else: Wait (improve ROI or find different problem to solve)
Real-World Migration Examples
Example 1: Dropbox (2010-2012)
From: Python โ Python + Rust (for file syncing)
Cost: Estimated $5-10M over 2 years
Payoff: 40% reduction in sync latency, better battery life
ROI: Millions per month (core product improvement)
Lesson: Strategic migrations (improve product) have higher ROI than cost migrations
Example 2: Heroku to AWS
From: Heroku (managed) โ AWS (self-managed)
Cost: $100k over 3 months (migration + consulting)
Savings: $500k/year (self-managing cheaper than Heroku premium)
Payback: 2.4 months โ
(very quick ROI)
Timeline: 3 months (longer than estimated due to DevOps learning curve)
Lesson: Migrations from expensive managed โ cheap self-managed always worth it
Example 3: Company Still Running Python 2.7 (2023)
Problem: Python 2 end-of-life (no security patches)
Migration to: Python 3
Status: Still not done! (4 years overdue)
Cost: Estimated $1-2M to do now (would have been $100k in 2018)
Lesson: Don't delay forced migrations (cost grows exponentially)
Usage in Commands
In /architect:recommend-stack
// After recommending Go option:
if user_concerned_about_switching_later:
simulate_swap("Node.js", "Go")
show: "If you scale to 1M DAU and want Go, it costs $50k and 10 weeks"
help user: "Is Node.js cheaper for your growth path?"
In /architect:blueprint-variants
// For each variant:
if switching_cost_significant:
add_to_report: "Switching from baseline to this option later costs $X"
help_user: "Choose baseline now to keep switching options open"
New command: /architect:simulate-migration
/architect:simulate-migration --from node --to go
โ Estimates cost, timeline, risk, ROI of migration
Related Skills
constraint-solver/ โ picks initial stack (reduces need to migrate)
stack-compatibility/ โ helps pick compatible stacks (easier to migrate between)
cost-optimizer/ โ estimates long-term costs (drives migration decisions)