<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by CobuildX AI on Medium]]></title>
        <description><![CDATA[Stories by CobuildX AI on Medium]]></description>
        <link>https://medium.com/@cobuildx.ai?source=rss-f6d64156316d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*IG1BGqA-cO5weMVTRtozFw.jpeg</url>
            <title>Stories by CobuildX AI on Medium</title>
            <link>https://medium.com/@cobuildx.ai?source=rss-f6d64156316d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 09:55:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cobuildx.ai/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Strangler Fig City: Modernize an Entire City]]></title>
            <link>https://medium.com/@cobuildx.ai/strangler-fig-city-modernize-an-entire-city-476befc4fd6b?source=rss-f6d64156316d------2</link>
            <guid isPermaLink="false">https://medium.com/p/476befc4fd6b</guid>
            <category><![CDATA[legacy-code]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[CobuildX AI]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 00:00:53 GMT</pubDate>
            <atom:updated>2026-11-16T07:00:07.902Z</atom:updated>
            <content:encoded><![CDATA[<p><em>We built a browser game where the city is your web app and every building is one unit of it. Rebuild them all in React without closing a single street. Here is what each of its five phases teaches about real migrations.</em></p><p>We’ve written thousands of words about the strangler fig pattern, parity testing and kill switches. They’re useful once you’ve lived through a migration. Before then, they’re just words. So we built a game instead.</p><p><a href="https://strangler-fig-city-migratex.cobuildx.ai/"><strong>Strangler Fig City</strong></a> is a short browser game played across <strong>12 levels</strong> on one road, from the legacy streets of Old Town, through the Construction Zone, to the new city. The city is a web app and every building is one unit of it: a screen, a component or a shared service. People walk the streets the whole time. Your guide, <strong>Mayor Rabbit Jr.</strong>, asks you to rebuild every building in React or Next.js <strong>without closing a single street</strong>. You start at 100% city health, and every shortcut a real migration team is tempted to take costs you some of it.</p><p>This post walks through the game level by level and explains what each one is really teaching. If you’d rather play first, go ahead. It takes about as long as reading this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2U7QmQ-ZCtMG6T_o.png" /></figure><blockquote><strong><em>Play it:</em></strong><em> </em><a href="https://strangler-fig-city-migratex.cobuildx.ai/"><em>Strangler Fig City</em></a><em>. Check in at City Hall: pick what your app runs on today (Angular, Ember, Backbone, jQuery or vanilla JS) and where you’re moving it (React or Next.js), and the Mayor quizzes you on it first. Not a developer? Choose </em><strong><em>Not a developer</em></strong><em> and you get everyday questions about renovating a house instead. The migration lessons are the same. Your progress saves as you go, so you can stop at any level and pick up where you left off.</em></blockquote><h3>Why a Game</h3><p>Most migration failures aren’t caused by code nobody understands. They come from decisions that looked sensible at the time: we’ll map the shared services later, we’ll test properly so we don’t need a rollback, the currency sign doesn’t matter. Each one feels small. The cost shows up weeks later, in production, and it’s hard to trace back to the decision that caused it.</p><p>A game closes that loop. You make the call, and a few minutes later you see what it cost. <strong>Every point you lose in Strangler Fig City traces back to a skipped step, never to the code itself.</strong> That’s also the most honest one-line summary of real migrations we know.</p><h3>The City Is Your App</h3><p>The board is a three-by-three city with eight units on it:</p><ul><li><strong>Store</strong>: Kind: Data service (hidden). Depends on: Nothing. Others depend on it.</li><li><strong>Auth</strong>: Kind: Session service (hidden). Depends on: Nothing. Others depend on it.</li><li><strong>Search</strong>: Kind: Component. Depends on: Store.</li><li><strong>Cart</strong>: Kind: Route. Depends on: Store.</li><li><strong>Login</strong>: Kind: Route. Depends on: Auth.</li><li><strong>Profile</strong>: Kind: Route. Depends on: Auth.</li><li><strong>Orders</strong>: Kind: Route. Depends on: Store, Auth.</li><li><strong>Footer</strong>: Kind: Component. Depends on: Nothing.</li></ul><p>Six of those are on any screen list a product manager would write. Two aren’t: <strong>Store</strong> and <strong>Auth</strong> start hidden under fog. They’re also the two everything else leans on. That’s not a contrivance for the game. It’s the shape of almost every legacy frontend we’ve migrated: a global store, a session service or an event bus that never shows up on a sitemap but that half the app reads from.</p><h3>Twelve Levels, One Road</h3><p>The game is a level map. Each level you clear unlocks the next and earns up to three stars, and the buildings along the road turn from orange to blue as you go. The first four levels get you ready. The last eight are the migration itself:</p><ul><li><strong>Level 1: City Hall check-in</strong> (Setup). Tell the Mayor your current stack and your target, and get your City Pass.</li><li><strong>Level 2: Skill check</strong> (Setup). A short quiz on the framework you picked.</li><li><strong>Level 3: Code preview</strong> (Setup). See each building’s code before and after the move, side by side.</li><li><strong>Level 4: Mission briefing</strong> (Setup). Get the keys to the city.</li><li><strong>Level 5: Scan the city</strong> (Scan). Find the hidden wiring.</li><li><strong>Level 6: Blueprint</strong> (Blueprint). Put foundations first.</li><li><strong>Level 7: Big calls</strong> (Blueprint). Strategy, rollback and shared data.</li><li><strong>Level 8: Build beside</strong> (Build). Port it unit by unit.</li><li><strong>Level 9: Incident!</strong> (Build). Handle live alerts in production.</li><li><strong>Level 10: Parity patrol</strong> (Inspect). Spot every difference.</li><li><strong>Level 11: Demolition day</strong> (Demolish). Retire the old code.</li><li><strong>Level 12: Grand opening</strong> (Report). Your migration report.</li></ul><p>The code preview in Level 3 is worth a minute even if you skip everything else. It shows Login, Cart and the rest written in the framework you picked and again in your target, so the move stops being abstract before you plan it.</p><h3>Five Phases, Five Real Steps</h3><p>Under the levels, the game follows the same five steps we use on client projects: Scan, Blueprint, Build, Inspect, Demolish.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fExaOZF7y3D02Oer.png" /></figure><p>You move between levels on the <strong>City Map</strong>, a road that winds from Old Town to the new city. Cleared levels show a tick and their stars, the level you’re on is marked with the Mayor’s pin, and the ones ahead stay locked. A bar across the top counts your stars and levels cleared and shows the move you picked. Inside each level, a strip above the board shows the level number and your city health. Real migrations need the same thing: a status everyone can read at a glance, so nobody has to ask what’s finished and what’s still legacy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YPM3DUiUabW4uYhe.png" /></figure><h4>1. Scan: the inventory</h4><p>You tap clouds to reveal the buildings under them. Most appear straight away. Some only give off a <strong>faint signal</strong>, and you have to tap again to deep scan. Those are Store and Auth.</p><p>Before you start, the Mayor asks where migrations usually get blindsided. The answer the game wants is “shared services and global state nobody drew on a diagram”. Screens are the easy part because they’re on every list. The surprises live underneath them.</p><p><strong>The real-world lesson:</strong> an inventory is not a list of routes. It’s a list of routes plus everything they reach into: stores, services, globals, event listeners, monkey-patched prototypes. If you skip the deep scan in the game, the unit stays unmapped and costs you <strong>12% city health</strong> later, in the Build phase, when a screen moves without the service it needs. The log tells you exactly why: <em>“Inventory gap: Store was never mapped, so Search, Cart, Orders moved without it.”</em> That’s the most expensive penalty in the game, and on real projects it’s the most expensive mistake too.</p><h4>2. Blueprint: the plan</h4><p>You drag the eight units into the order you’ll rebuild them. A red pill appears on any unit placed before something it depends on. Put Cart above Store and the game flags it at once.</p><p><strong>The real-world lesson:</strong> foundations go first. A screen can only move once the services it uses exist on the new side. Move a screen before its foundation and it ends up talking to two different versions of the truth. In the game that costs <strong>8%</strong> per unit, and the log reads <em>“Users hit a short hiccup.”</em> In production the hiccup is a cart showing three items on one page and two on the next.</p><p>Then the Mayor brings three questions every migration team argues about:</p><ul><li><strong>How do we move?</strong>: The right call: Strangler fig: one unit at a time behind a router. Why the others lose points: A feature freeze stalls the business for months. A big-bang switch puts every risk on one night with no fallback.</li><li><strong>How do we undo a bad release?</strong>: The right call: A router flag that sends traffic back to legacy in seconds. Why the others lose points: “Keep the old build tagged” means a slow, all-or-nothing redeploy. “We’ll test properly” means a bug becomes an outage.</li><li><strong>How do old and new share data?</strong>: The right call: One source of truth, with a bridge both sides talk to. Why the others lose points: Separate copies drift apart. Moving the Store last forces every new screen to reach into legacy state.</li></ul><p>When you lock the plan, the game says <em>“A router now sits in front of the city, so old and new can run side by side.”</em> That one sentence is the whole strangler fig pattern.</p><h4>3. Build: the port</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5u2GQ2Y0VvNgiRjl.png" /></figure><p>Each React building goes up <strong>beside</strong> the old one, not on top of it. A bar under every building fills from orange to blue as the router moves users across. The old building keeps working the whole time.</p><p>Each move has three steps: <strong>check before</strong>, <strong>move</strong>, <strong>check after</strong>. The checklists are specific to each unit, and they’re the ones we actually use. For Login: write down the cookie name, token shape and expiry; make sure both apps can read the same session; check that the wrong-password message is identical; confirm password managers still autofill. For Cart: write down price, tax and rounding rules, because currency and rounding are where carts quietly differ. You can skip the checks. It costs 2% each time.</p><p>You also choose <strong>canary</strong> or <strong>all at once</strong>. With a canary, 10% of users get the new building first. If something is slightly off, only that 10% sees it. All at once, everyone does. The log spells it out: <em>“No canary: Cart had small differences, and every user hit them at once instead of 10%.”</em></p><p>Then Level 9 fires three live alerts, one after another. Each is a real production incident we’ve seen on migrations:</p><ul><li><strong>Errors on a freshly moved unit jump to 3%</strong>: The right call: Flip traffic back to legacy, then fix calmly. Why: Users are back on the working version in seconds. Hot-fixing under fire keeps 3% of requests failing, and rushed fixes cause new bugs.</li><li><strong>Search now takes 2 seconds instead of feeling instant</strong>: The right call: Compare old and new on the same queries, and flip Search alone back if it’s slower. Why: Measure first, then use the per-unit switch. Rolling the whole app back throws away every unit that works fine.</li><li><strong>Old Orders page shows 3 items in the cart, new Cart page shows 2</strong>: The right call: Two copies of the data are drifting. Point both sides at the one shared Store. Why: It isn’t a cache or CSS problem. Old and new must read one source of truth, and drift shows up on screen first.</li></ul><p>The kill switch and shared Store you chose in Level 7 are what make the calm answers possible. <strong>A rollback you can run in 30 seconds turns an incident into a blip.</strong></p><h4>4. Inspect: parity</h4><p>This is the phase people underestimate, in the game and in real life. You see the old version and the new version of a unit side by side, line by line, and you tap every line in the port that doesn’t match the original.</p><ul><li><strong>Cart</strong>: Line: Order total. Legacy: $40.00. React port: 40. Kind of gap: Data.</li><li><strong>Cart</strong>: Line: Checkout button. Legacy: Buy now. React port: Pay. Kind of gap: Markup.</li><li><strong>Login</strong>: Line: Wrong password. Legacy: Shows “Wrong password”. React port: Shows a general sign-in error. Kind of gap: Behavior.</li><li><strong>Login</strong>: Line: Field order. Legacy: Email, then password. React port: Password, then email. Kind of gap: Markup.</li><li><strong>Orders</strong>: Line: Status after save. Legacy: Updates at once. React port: Updates on next page load. Kind of gap: Timing.</li></ul><p>Five gaps, mixed in with lines that match exactly. None of them would fail a compile or a typical unit test. Every one of them would generate a support ticket. These are the four kinds of drift we check on every real port: <strong>data, markup, behavior and timing</strong>.</p><p>The Mayor’s questions here are about judgment, not just spotting:</p><ul><li><strong>The cart total is missing its currency sign. Fix it before cutover?</strong> Yes. Match the old behavior first and improve later. Finance, support and international users all read that sign.</li><li><strong>Who signs off that the Login port really matches?</strong> Automated parity tests plus a product owner. The person who wrote the port is the one most likely to miss their own blind spots.</li><li><strong>A PM says users will like that order status now updates on the next page load. Keep it?</strong> No. Keep the old timing now and propose the change as its own release. Quiet behavior changes inside a migration break habits and scripts people rely on.</li></ul><p>Tapping a line that matches is free, so the game rewards looking closely over guessing.</p><h4>5. Demolish: the cutover</h4><p>Everyone is on React. Now you retire the old buildings. If you missed a parity gap in Inspect, this is where it surfaces, because removing the old copy removes the fallback. The log reads <em>“Missed in review”</em> for each gap you let through, and each costs <strong>6%</strong>.</p><p>The final question: when is it safe to delete the old code? The game’s answer is <strong>after parity is proven and both versions have run side by side for a while, with the kill switch kept until then.</strong> That soak period catches the rare, slow bugs while there’s still somewhere to fall back to. “Never, keep both just in case” loses points too. Two codebases forever means double the bugs, double the upkeep and a migration that never ends.</p><h3>What the Score Actually Measures</h3><p>You start at 100% city health. A grade of A+ needs 95% or more. Here’s the full penalty table:</p><ul><li><strong>Unit never mapped</strong>: When it shows up: Build. Cost: −12%.</li><li><strong>Unit moved before what it needs</strong>: When it shows up: Build. Cost: −8%.</li><li><strong>Parity gap not flagged</strong>: When it shows up: Demolish. Cost: −6%.</li><li><strong>A risky migration call</strong>: When it shows up: Any phase. Cost: −2% to −10%.</li><li><strong>Skipping a before or after check</strong>: When it shows up: Build. Cost: −2%.</li><li><strong>Tapping a line that matches</strong>: When it shows up: Inspect. Cost: Free.</li></ul><p>Notice the column in the middle. <strong>Mistakes don’t cost you when you make them. They cost you later, in a different phase.</strong> An inventory gap from phase 1 shows up in phase 3. A parity gap from phase 4 shows up in phase 5. That delay is exactly what makes real migrations hard to steer, and it’s why the order of the work matters so much.</p><p>A perfect run means finding all eight units, moving Store and Auth first, flagging all five parity gaps and making every call right. It’s very doable. It just doesn’t allow shortcuts.</p><h3>Save, Learn and Share</h3><p>Five minutes is the target, but meetings happen. The game is built so you can stop, come back, read deeper and challenge your team.</p><h4>Your city is saved</h4><p>Progress saves in your browser after every move. That covers the frameworks you picked, your skill-check answers, the code preview, your stars and every level. Come back later and the title screen offers <strong>Continue</strong> at the exact level you left. <strong>Start over</strong> clears it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oTR9OXIf8XmhjwcT.png" /></figure><p>In Level 1 the Mayor prints your <strong>City Pass</strong>. Give it your work email and it saves your progress across all 12 levels, and we send you the free MigrateX migration guide for the move you picked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Zg_oTqNb-3i3J3Va.png" /></figure><h4>Go deeper on each phase</h4><p>Every level that plays a phase ends with a short <strong>Go deeper</strong> box linking to the MigrateX writing behind it. Scan points to our guide on choosing a migration strategy and to the open-source cbx-plugins. Blueprint points to the modernization mistakes post and the Shopify lessons. Build shows the migration guide for the framework you picked, Inspect points to AI agents for QA and our parity-tested examples, and Demolish to multi-agent modernization and Martin Fowler’s original Strangler Fig article. The results screen collects all of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hyecpFEdSYQLKBcH.png" /></figure><h4>Share your score card</h4><p>You can share your progress at any point, and the results screen asks you to challenge your friends and colleagues. Each share comes with a <strong>score card image</strong> drawn from your own run: your grade, city health, frameworks, incidents and a skyline that turns from orange to blue as you migrate. Share it straight to LinkedIn, X, WhatsApp or email, copy the link, or download or copy the image to attach to your post. On a phone, your share menu works too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aixEEarxFCRhWCHY.png" /></figure><h3>The Glossary, in One Place</h3><p>These are the terms the game uses as you play. They work well as a shared vocabulary for a team about to start a migration:</p><ul><li><strong>Unit:</strong> one piece that moves on its own: a route, a component or a service.</li><li><strong>Strangler fig:</strong> grow the new app around the old one and move traffic over piece by piece.</li><li><strong>Router:</strong> sends each request to the old or new version, so both run at once.</li><li><strong>Canary:</strong> send a small slice of users to the new version first, then widen.</li><li><strong>Kill switch:</strong> a flag that sends traffic back to legacy in seconds.</li><li><strong>Parity:</strong> the port matches its original in behavior, markup, data and timing.</li><li><strong>Soak:</strong> time both versions run side by side before the old one is deleted.</li><li><strong>Cutover:</strong> the moment legacy code is retired for good.</li><li><strong>Big-bang:</strong> rebuild everything separately, then switch all at once.</li></ul><h3>About MigrateX</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/0*mAXvR59qA3XJIgS5.png" /></figure><p>MigrateX is our software and services platform for moving software, data and infrastructure from one technology to another. It brings automation and experienced engineers together, so the repetitive work gets done quickly and the tricky decisions get the human attention they need.</p><p>Strangler Fig City is a small version of how we run migrations with MigrateX. Here’s what each phase looks like on a real codebase:</p><ol><li><strong>Assessment (Scan).</strong> We map every route, component, service, endpoint, background job and piece of hidden wiring, including the Stores and Auths nobody drew on a diagram. You get a clear picture of where the effort really sits before anyone commits to a timeline.</li><li><strong>Migration plan (Blueprint).</strong> Together with your team, we build the dependency graph that puts foundations first, decide what each piece becomes on the new stack, mark what can simply be deleted, and agree on the router, the kill switch and the shared data layer.</li><li><strong>Step-by-step migration (Build).</strong> Each piece moves behind a switch you can turn off, with a canary before full traffic. Automation handles the repetitive parts. Our engineers handle the parts that need judgement, like state design and the bridge that lets old and new share one site.</li><li><strong>Proof that it works (Inspect).</strong> The same UI and API tests run against the old and the new version, and a piece only counts as migrated when it passes on both. Behavior, markup, data and timing differences get flagged before cutover, not after.</li><li><strong>Handover and clean-up (Demolish).</strong> We keep a way back until traffic is quiet, then remove the old code, the switches and the temporary glue, and leave your team with a codebase they know and own.</li></ol><p><strong>What you get along the way:</strong></p><ul><li><strong>No big-bang release.</strong> Your app keeps running and shipping features while the migration happens in the background. The city never closes.</li><li><strong>Less risk.</strong> Shared tests, feature flags and a way back mean users don’t notice the move, and you can pause at any point.</li><li><strong>A team that’s ready.</strong> We pair with your developers throughout, so they’re comfortable with the new stack long before the last legacy screen is gone.</li><li><strong>More than front ends.</strong> The same approach covers backends (Java, Python, Node.js, COBOL, PHP, RPG) and cloud moves between GCP and AWS.</li><li><strong>Run it yourself if you prefer.</strong> Our open-source plugins for Claude Code, Cursor and GitHub Copilot follow the same method. Source at <a href="https://github.com/cobuild-tech/cbx-plugins">cobuild-tech/cbx-plugins</a>.</li></ul><blockquote><strong><em>Play </em></strong><a href="https://strangler-fig-city-migratex.cobuildx.ai/"><strong><em>Strangler Fig City</em></strong></a><em>, then share your score card with the person on your team who still thinks a big-bang rewrite will be fine. To see the method on real code, visit </em><a href="https://github.com/cobuild-tech/migratex-examples"><strong><em>github.com/cobuild-tech/migratex-examples</em></strong></a><em>. Have a real city to move? Tell us a little about your app through </em><a href="https://cobuildx.ai/contact"><em>Contact Us</em></a><em>, or </em><a href="https://cobuildx.ai/migratex"><em>start with a MigrateX assessment</em></a><em>, and we’ll begin with a free conversation about where the effort is likely to be.</em></blockquote><h3>References</h3><p><strong>Migration strategy</strong></p><ul><li><a href="https://cobuildx.ai/blog/frontend-migration-strategies">Strangler Fig, Branch by Abstraction, Vertical Slices: Choosing a Frontend Migration Strategy</a></li><li><a href="https://cobuildx.ai/blog/modernization-mistakes-to-avoid">10 Legacy Modernization Mistakes You’re Making (and How to Avoid Them)</a></li><li><a href="https://cobuildx.ai/blog/software-migration-lessons-shopify">6 Software Migration Lessons from Shopify’s 12-Week AI-Assisted Rewrite</a></li><li><a href="https://cobuildx.ai/blog/modernizing-legacy-apps-with-rxjs">Modernizing Legacy Apps with RxJS: Streams as the Bridge Between Old and New</a></li></ul><p><strong>Frontend migration guides</strong></p><ul><li><a href="https://cobuildx.ai/blog/angular-to-react-migration-guide">Moving from Angular to React: A Practical Guide</a></li><li><a href="https://cobuildx.ai/blog/ember-to-react-migration-guide">Leaving Ember for React: What Your Conventions Were Hiding</a></li><li><a href="https://cobuildx.ai/blog/backbone-to-react-migration-guide">The Framework Nobody Wrote Down: Taking a Backbone App to React</a></li><li><a href="https://cobuildx.ai/blog/jquery-to-react-migration-guide">Who Updates the Total? Taking a jQuery App to React</a></li><li><a href="https://cobuildx.ai/blog/vanilla-js-to-react-migration-guide">The State Is in the DOM: Taking a Vanilla JavaScript App to React</a></li><li><a href="https://cobuildx.ai/blog/one-way-two-way-binding">One-Way vs Two-Way Binding: How Each Works and Migrating Both Ways</a></li><li><a href="https://cobuildx.ai/blog/csr-vs-ssr">Client-Side vs Server-Side Rendering: How Each Works and Migrating Both Ways</a></li></ul><p><strong>Backend migration guides</strong></p><ul><li><a href="https://cobuildx.ai/blog/java-to-rust-migration-guide">Everything Is Static: Taking a Java Web App to Rust</a></li><li><a href="https://cobuildx.ai/blog/php-to-rust-migration-guide">Everything Is an Array: Taking a PHP App to Rust</a></li><li><a href="https://cobuildx.ai/blog/cobol-to-rust-migration-guide">The Program Is the Data Layout: Taking a COBOL System to Rust</a></li></ul><p><strong>Cloud migration guides</strong></p><ul><li>AWS to GCP: <a href="https://cobuildx.ai/blog/aws-to-gcp-compute-options">compute</a>, <a href="https://cobuildx.ai/blog/aws-to-gcp-big-data">big data</a>, <a href="https://cobuildx.ai/blog/aws-to-gcp-serverless">serverless</a>, <a href="https://cobuildx.ai/blog/aws-to-gcp-storage">storage</a></li><li>GCP to AWS: <a href="https://cobuildx.ai/blog/gcp-to-aws-compute-options">compute</a>, <a href="https://cobuildx.ai/blog/gcp-to-aws-big-data">big data</a>, <a href="https://cobuildx.ai/blog/gcp-to-aws-serverless">serverless</a>, <a href="https://cobuildx.ai/blog/gcp-to-aws-storage">storage</a></li><li><a href="https://cobuildx.ai/blog/gke-terraform-silent-drift">When Terraform Plans Lie: Two GKE Issues and How to Catch Them</a></li></ul><p><strong>AI-assisted modernization</strong></p><ul><li><a href="https://cobuildx.ai/blog/multi-agent-modernization">10x Your Modernization Efforts With Multi-Agent Teams</a></li><li><a href="https://cobuildx.ai/blog/ai-agents-qa-team-modernization">Techniques for Making AI Agents Your QA Team for Reliable Modernization</a></li></ul><p><strong>Source code and further reading</strong></p><ul><li>CobuildX AI. <em>cbx-plugins</em>: open-source Claude Code, Cursor and Copilot plugins for frontend migrations. <a href="https://github.com/cobuild-tech/cbx-plugins">https://github.com/cobuild-tech/cbx-plugins</a></li><li>CobuildX AI. <em>migratex-examples</em>: reference migrations with the original app, the port and the parity tests. <a href="https://github.com/cobuild-tech/migratex-examples">https://github.com/cobuild-tech/migratex-examples</a></li><li>M. Fowler. <em>Strangler Fig.</em> martinfowler.com, 22 August 2024 (first published 2004). <a href="https://martinfowler.com/bliki/StranglerFigApplication.html">https://martinfowler.com/bliki/StranglerFigApplication.html</a></li></ul><p><em>CobuildX helps teams migrate legacy applications and cloud infrastructure with </em><a href="https://cobuildx.ai/migratex"><em>MigrateX</em></a><em>.</em></p><p><em>Originally published on the </em><a href="https://cobuildx.ai/blog/strangler-fig-city-migration-game"><em>CobuildX blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=476befc4fd6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[6 Software Migration Lessons from Shopify’s 12-Week AI-Assisted Rewrite]]></title>
            <link>https://medium.com/@cobuildx.ai/6-software-migration-lessons-from-shopifys-12-week-ai-assisted-rewrite-4da0630d476b?source=rss-f6d64156316d------2</link>
            <guid isPermaLink="false">https://medium.com/p/4da0630d476b</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[legacy-modernization]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[CobuildX AI]]></dc:creator>
            <pubDate>Wed, 04 Nov 2026 04:45:43 GMT</pubDate>
            <atom:updated>2026-11-04T04:45:43.793Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A team of six at Shopify moved a major production app to a new stack in 12 weeks, with AI agents doing most of the porting. The lessons apply to any legacy modernization: the old system is the spec, parity is done, and humans approve.</em></p><p>Every engineering team has a migration it keeps postponing. Maybe it’s a monolith that should have been split years ago, a framework two major versions behind, a database the business has outgrown, or a language nobody wants to hire for. Everyone agrees it should happen, and nobody wants to pay for it.</p><p>Shopify recently showed how quickly that calculation is changing. A team of six moved a major production app to a new stack in <strong>12 weeks</strong>, with AI coding agents doing most of the porting (<a href="https://shopify.engineering/shop-app-migration">read Shopify’s post</a>). Their case was a mobile app, but the lessons have nothing to do with mobile. They apply to any <strong>legacy modernization</strong> project, whether that’s a backend, a data platform or an internal tool.</p><p>Here’s what we took from it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qeZCf3CJhSKid8kk.png" /></figure><h3>1. Revisit the migration you shelved, because the cost has changed</h3><p>Shopify didn’t migrate because the old system broke. They migrated because AI agents changed what it would cost to move. A rewrite that couldn’t be justified a year ago became a 12-week project.</p><p>Most <strong>migration strategy</strong> discussions take the cost of moving as a given. It isn’t anymore. If your team ruled out a migration as “too expensive” more than a year ago, it’s worth asking again.</p><h3>2. Your legacy system is the spec</h3><p>Shopify found that agents work best when there’s an existing implementation to use as a reference. That’s the hidden advantage of migrations over new builds. You aren’t asking AI to guess what to build. You’re asking it to reproduce behavior that already exists, runs in production and has years of edge cases baked in.</p><p>Shopify’s process started with <strong>documenting how the old system behaved</strong> (its UI, state, data flows, analytics and accessibility) before writing any new code. Every <strong>software migration</strong> should start the same way: build an inventory of what the legacy system actually does, not what the documentation says it does. That inventory is what you test the new system against.</p><blockquote><em>“To me, legacy code is simply code without tests.” — </em><strong><em>Michael Feathers</em></strong><em>, </em><a href="https://www.oreilly.com/library/view/working-effectively-with/0131177052/"><em>Working Effectively with Legacy Code</em></a></blockquote><h3>3. Parity is the definition of done</h3><p>This is the most important lesson, and the one most teams skip. Shopify built an internal tool that captured outputs from <strong>both</strong> the old and new systems at named checkpoints. Agents then compared them automatically, ignoring expected noise like timestamps and IDs.</p><p>Generated code that *looks* right isn’t the goal. The goal is a new system that *behaves* like the old one, including the parts nobody remembers to test:</p><ul><li>Events and data feeds that downstream systems depend on</li><li>Users and sessions that carry across without interruption</li><li>Integrations, notifications and background jobs</li></ul><p>Shopify treated their analytics events as a contract, because other systems relied on them. Every <strong>legacy system migration</strong> has contracts like that, and most aren’t written down. Parity checks are the best <strong>risk mitigation</strong> you have: without them, an AI migration just moves the risk somewhere else.</p><blockquote><em>Code that looks right isn’t done. A new system that behaves like the old one, checked with evidence, is.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*12ce96k1HXcHTJkI.png" /></figure><blockquote><em>“With a sufficient number of users of an API, it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody.” — </em><strong><em>Hyrum Wright</em></strong><em>, </em><a href="https://www.hyrumslaw.com/"><em>Hyrum’s Law</em></a></blockquote><h3>4. Humans approve, agents execute</h3><p>Shopify didn’t let agents run unchecked. Engineers reviewed requirements and plans before any code was written, and each approval was <strong>tied to a content hash</strong>. If the plan changed, the approval was voided automatically.</p><p>They also kept experienced engineers reviewing the output, because generated code could meet every requirement and still add duplication, architectural drift or performance problems.</p><p>That’s the right split for any serious <strong>application migration</strong>. Agents bring speed and scale. People own the decisions, the quality bar and the sign-off, and every change can be traced back to an approved plan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QbwIogZGDdsDIaGQ.png" /></figure><h3>5. Parallelize the work, but keep the feedback loop fast</h3><p>Shopify ran many agent sessions at once, each in its own git worktree, instead of making one change at a time. They also gave agents direct access to the running system’s logs, events and state, so agents could check their own work.</p><p>The pattern carries over to any migration:</p><ol><li>Split the work into independent lanes (modules, services or features).</li><li>Give each lane a clear, approved task definition.</li><li>Give agents a fast way to build, test and observe the result.</li><li>Review often.</li></ol><p>The bottleneck moves from typing code to defining tasks well and reviewing results quickly. Plan your team’s time around that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*InzQxY3-22G4AQhH.png" /></figure><h3>6. Migrate and simplify at the same time</h3><p>Shopify didn’t port everything one to one. They retired some screens and simplified others. A migration is the cheapest chance you’ll ever get to drop dead code, unused features and accidental complexity, since you’re touching everything anyway. Decide what *not* to migrate before you start.</p><blockquote><em>“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” — </em><strong><em>Antoine de Saint-Exupéry</em></strong><em>, </em><a href="https://en.wikipedia.org/wiki/Wind,_Sand_and_Stars"><em>Wind, Sand and Stars</em></a></blockquote><h3>What’s still missing: the last mile of a software migration</h3><p>Shopify’s post focuses on building and verifying the new system. It says little about feature flags, gradual rollout or rollback, which is where many migrations actually fail.</p><p>At <strong>MigrateX</strong>, we see a migration as everything from understanding the old system to safely retiring it:</p><ol><li><strong>Discover</strong> what the legacy system really does</li><li><strong>Plan</strong> the migration, with human approval</li><li><strong>Migrate</strong> in parallel lanes with AI agents</li><li><strong>Verify</strong> parity against the original</li><li><strong>Roll out</strong> gradually, with rollback ready</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ElkX8pN8CbWidSgs.png" /></figure><h3>The takeaway</h3><p>AI can turn a multi-quarter migration into a matter of weeks. But Shopify’s speed came from <strong>discipline, not just code generation</strong>: they treated the old system as the spec, proved parity, gated plans and kept humans on review.</p><p>That discipline is what we’re building into MigrateX. <strong>Have a migration you’ve been putting off?</strong> <a href="https://cobuildx.ai/migratex">Talk to us about a migration feasibility sprint</a>.</p><h3>Key takeaways</h3><ul><li>AI agents have changed the cost of migrating, so re-check the migrations you shelved.</li><li>Inventory what the old system actually does; that inventory is the spec.</li><li>Done means behavioral parity, proven with side-by-side checks, not code that looks right.</li><li>Engineers approve plans and review output; agents do the volume in parallel lanes.</li><li>Plan the rollout and rollback, not just the rewrite.</li></ul><p>*Source: Shopify Engineering, <a href="https://shopify.engineering/shop-app-migration">Shop app migration</a>. Figures are from Shopify’s post.*</p><p><strong>Related reading:</strong> <a href="https://cobuildx.ai/blog/multi-agent-modernization">how multi-agent AI speeds up application migration</a>, <a href="https://cobuildx.ai/blog/ai-agents-qa-team-modernization">a migration testing strategy with AI agents</a> and <a href="https://cobuildx.ai/blog/modernization-mistakes-to-avoid">10 legacy modernization mistakes to avoid</a>.</p><p><em>Originally published on the </em><a href="https://cobuildx.ai/blog/software-migration-lessons-shopify"><em>CobuildX blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4da0630d476b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Moving Compute from GCP to AWS: VMs, Kubernetes and GPUs]]></title>
            <link>https://medium.com/@cobuildx.ai/moving-compute-from-gcp-to-aws-vms-kubernetes-and-gpus-eccac7e40df9?source=rss-f6d64156316d------2</link>
            <guid isPermaLink="false">https://medium.com/p/eccac7e40df9</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-migration]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[CobuildX AI]]></dc:creator>
            <pubDate>Wed, 28 Oct 2026 12:14:24 GMT</pubDate>
            <atom:updated>2026-10-28T12:14:24.738Z</atom:updated>
            <content:encoded><![CDATA[<h4>A plain-English guide to moving compute from Google Cloud to AWS: VMs, instance groups, Spot, GKE, GPUs, TPUs and batch. What replaces what, what behaves differently, what changes on the bill, and a step-by-step plan.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w0PN9m-slHAzeaah.png" /></figure><p>“Compute” is the part of the cloud that runs your code: virtual machines, Kubernetes nodes, GPU machines and batch jobs. When a team moves from Google Cloud (GCP) to AWS, compute is usually the first thing they plan.</p><p>Teams move for simple reasons. The rest of the company is already on AWS. A company they bought came with an AWS account. Their credits ran out on one cloud and started on the other. Or the data they need already lives in AWS.</p><p>Most teams start with a table: Compute Engine goes to EC2, GKE goes to EKS, GPUs go to GPUs. That table is a good start, but it hides the real work. Services that do the same job often behave a little differently. Machine sizes, maintenance, Spot, pod networking and discounts all change, and those changes show up in production, not on the diagram.</p><p>In this post we go through every GCP compute option one by one. For each, we say what replaces it on AWS, what is different, and what changes on the bill. At the end we show a step-by-step plan and how we run these moves with MigrateX.</p><blockquote><strong><em>This guide covers compute.</em></strong><em> For Cloud Run, Cloud Run functions and Lambda, see </em><a href="https://medium.com/blog/gcp-to-aws-serverless"><em>moving serverless from GCP to AWS</em></a><em>. For Persistent Disk and Filestore, see </em><a href="https://medium.com/blog/gcp-to-aws-storage"><em>moving storage from GCP to AWS</em></a><em>. For Dataproc and Dataflow, see </em><a href="https://medium.com/blog/gcp-to-aws-big-data"><em>moving big data from GCP to AWS</em></a><em>.</em></blockquote><h3>The Quick Map</h3><p>Here is every GCP compute option and its closest match on AWS. The rest of the post explains each row.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HqaelK3MsT735k42.png" /></figure><ul><li><strong>Compute Engine VMs</strong> — Closest AWS match: EC2; Watch out for: No custom machine sizes; pick the next size up</li><li><strong>Instance templates</strong> — Closest AWS match: EC2 launch templates; Watch out for: Different fields; rebuild them, don’t convert</li><li><strong>Managed instance groups (MIGs)</strong> — Closest AWS match: EC2 Auto Scaling groups; Watch out for: Health checks and zones are set up differently</li><li><strong>Spot VMs / preemptible VMs</strong> — Closest AWS match: EC2 Spot Instances; Watch out for: Different warning time and pricing</li><li><strong>Sole-tenant nodes</strong> — Closest AWS match: EC2 Dedicated Hosts; Watch out for: Licence rules differ per host type</li><li><strong>Machine images, custom images</strong> — Closest AWS match: Amazon Machine Images (AMIs); Watch out for: Rebuild or replicate; you can’t copy them across</li><li><strong>Persistent Disk on a VM</strong> — Closest AWS match: Amazon EBS; Watch out for: Covered in the Storage post</li><li><strong>GKE Standard</strong> — Closest AWS match: EKS with managed node groups or Karpenter; Watch out for: Pods use real VPC IPs; plan subnets</li><li><strong>GKE Autopilot</strong> — Closest AWS match: EKS Auto Mode; Watch out for: Nodes are replaced at least every 21 days</li><li><strong>GPU machines (A2, A3, A4, G2)</strong> — Closest AWS match: EC2 P and G instances; Watch out for: Getting capacity is the hard part</li><li><strong>Cloud TPU</strong> — Closest AWS match: Trainium / Inferentia, or GPUs; Watch out for: There is no TPU on AWS</li><li><strong>Batch</strong> — Closest AWS match: AWS Batch; Watch out for: Job settings and retries map loosely</li><li><strong>App Engine</strong> — Closest AWS match: Elastic Beanstalk or App Runner; Watch out for: Often a good time to move to containers</li><li><strong>Cloud Run / Cloud Run functions</strong> — Closest AWS match: App Runner, ECS on Fargate, Lambda; Watch out for: See the Serverless post</li><li><strong>Bare Metal Solution</strong> — Closest AWS match: EC2 bare metal (.metal) instances; Watch out for: Check hardware and licence needs</li></ul><h3>Virtual Machines: Compute Engine to EC2</h3><p>This is the easiest part of the move. Both clouds group their machines by job: general purpose, compute-heavy, memory-heavy and GPU. So matching them is mostly a lookup:</p><ul><li><strong>E2</strong> — Used for: Cheap, light general use; AWS family: t3 / t4g; Note: AWS uses CPU credits; busy machines can slow down</li><li><strong>N2, N2D, N4</strong> — Used for: General purpose; AWS family: m7i / m8i, m7a; Note: Intel and AMD options on both sides</li><li><strong>Tau T2A, Axion (C4A)</strong> — Used for: Arm general purpose; AWS family: m8g, c8g (Graviton); Note: Often the cheapest per unit of work</li><li><strong>C3, C4, C2</strong> — Used for: Compute-heavy; AWS family: c7i / c8i, c7a; Note: Match by vCPU and clock speed, not by name</li><li><strong>M1, M2, M3</strong> — Used for: Large memory; AWS family: r8i, x2iedn, u-series; Note: Check memory per vCPU</li><li><strong>A2, A3, G2</strong> — Used for: GPU; AWS family: P4d, P5, G6; Note: See the GPU section below</li></ul><p>Two things don’t carry over:</p><ul><li><strong>Custom machine types.</strong> On GCP you can ask for any shape, say 6 vCPUs and 20 GB of memory. EC2 only sells fixed sizes, so you round up and pay for the gap. Before you round up, look at what the VM really uses. Many custom shapes were guesses made years ago.</li><li><strong>Live migration.</strong> When Google does maintenance, it moves your running VM to new hardware without a reboot. EC2 instead schedules maintenance events, which can mean a stop and start. If a single VM can’t be restarted, put it behind an Auto Scaling group or run a second copy.</li></ul><blockquote><strong><em>Rule of thumb:</em></strong><em> size EC2 from measured CPU and memory, not from the GCP machine type. Rounding up every custom shape is the quickest way to make AWS look more expensive than it is.</em></blockquote><h3>What changes inside the VM</h3><ul><li><strong>Google guest agent</strong> — On AWS: SSM Agent and cloud-init</li><li><strong>Startup script in instance metadata</strong> — On AWS: EC2 user data</li><li><strong>Metadata server at </strong><strong>metadata.google.internal</strong> — On AWS: Instance metadata (IMDSv2) at 169.254.169.254</li><li><strong>VM service account</strong> — On AWS: IAM role attached through an instance profile</li><li><strong>OS Login / SSH keys in metadata</strong> — On AWS: SSM Session Manager (no open SSH port needed)</li><li><strong>Google-provided OS images</strong> — On AWS: Amazon Linux, Ubuntu, RHEL or Windows AMIs</li></ul><h3>Instance Groups: MIGs to Auto Scaling Groups</h3><p>A managed instance group (MIG) is a group of identical VMs that grows or shrinks on its own. It’s built from an instance template. On AWS the same thing is an <strong>Auto Scaling group</strong> built from a <strong>launch template</strong>.</p><p>Scaling on CPU, rolling updates and replacing broken VMs all have direct matches. Two details are different:</p><ul><li><strong>Zones.</strong> A regional MIG spreads across zones by itself. An Auto Scaling group only spreads across the subnets you give it, so give it one subnet in each Availability Zone.</li><li><strong>Health checks.</strong> A MIG uses its own health check to replace broken VMs. An Auto Scaling group only checks that the EC2 machine is up, unless you switch it to use the load balancer’s health check (health_check_type = &quot;ELB&quot;).</li></ul><p>Load balancers change too. Google’s global HTTP(S) load balancer usually becomes an Application Load Balancer (ALB), and TCP/UDP load balancers become Network Load Balancers (NLB). AWS load balancers are regional, so for global traffic add Route 53 or CloudFront in front.</p><h3>Cheaper Capacity: Spot VMs</h3><p>Both clouds sell spare machines at a big discount and take them back when they need them. The rules are different:</p><ul><li><strong>Warning before it’s taken back</strong> — GCP Spot VMs: 0 seconds by default, or 120 seconds if you set it; EC2 Spot Instances: Two minutes, best effort</li><li><strong>Price</strong> — GCP Spot VMs: Fixed discount, changes at most once a month; EC2 Spot Instances: Changes slowly by instance type and zone</li><li><strong>How you find out</strong> — GCP Spot VMs: Shutdown signal, metadata server; EC2 Spot Instances: Instance metadata and an EventBridge event</li><li><strong>Best practice</strong> — GCP Spot VMs: Spread across zones and machine types; EC2 Spot Instances: List many instance types and use capacity-optimized allocation</li></ul><p>Shutdown scripts written for GCP usually still work. You just need to change them to read the AWS notice. The bigger change is to <strong>use many instance types</strong>. A group that lists one instance type gets interrupted far more often than one that lists ten.</p><h3>Dedicated Hardware and Licences</h3><p>Sole-tenant nodes become <strong>EC2 Dedicated Hosts</strong>. Most teams use them for software licensed per physical core, like Windows Server or SQL Server under bring-your-own-licence terms. Read your licence terms for AWS before you move. Often it’s cheaper to use licence-included EC2 instances and drop dedicated hardware completely.</p><p>If you use <strong>Bare Metal Solution</strong> (for example, for Oracle), look at EC2 bare metal instances, or Amazon RDS if the database can be managed for you.</p><h3>Moving the VMs Themselves</h3><p>There are two ways to get a VM onto EC2: copy the running server, or rebuild it from code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RxDLUNRA9ZXDENPa.png" /></figure><ul><li><strong>Copy it (rehost).</strong> AWS Transform MGN (formerly AWS Application Migration Service) copies servers to AWS with very little downtime. You install an agent on the GCP VM. It keeps copying the disks to AWS. You launch a test machine, check it, then switch over in minutes. Use this for old servers nobody can rebuild, licensed software, or hand-tuned databases.</li><li><strong>Rebuild it.</strong> If the VM is built from a startup script, Ansible or Packer, use the same tools to build an AMI (Packer’s amazon-ebs builder, or EC2 Image Builder) and launch it from an Auto Scaling group. It&#39;s more work at first, but you get something you can rebuild any time.</li></ul><p>Either way, plan the network around the move. IP addresses change, so use DNS names, not hard-coded IPs. Lower DNS TTLs a few days before you switch. And set up a private link between the clouds (VPN or Interconnect to Direct Connect) so old and new servers can talk while both are running.</p><h3>Kubernetes: GKE to EKS</h3><p>Your Kubernetes manifests and Helm charts mostly move as they are. The cluster around them doesn’t. Four things catch almost every team:</p><ul><li><strong>Networking.</strong> On EKS, every pod gets a real IP address from your VPC subnet. A busy cluster in a small subnet runs out of addresses fast. Use bigger subnets, or turn on prefix delegation, before you move workloads.</li><li><strong>Identity.</strong> GKE Workload Identity becomes EKS Pod Identity (or the older IRSA). Each Kubernetes service account gets an IAM role. It’s the same idea, but every link has to be made again. This is where most “access denied” errors come from in the first week.</li><li><strong>Ingress.</strong> GKE creates Google load balancers for you. On EKS, install the AWS Load Balancer Controller, which creates ALBs and NLBs. The annotations are different, so check every Ingress.</li><li><strong>Nodes.</strong> If you use GKE Autopilot, EKS Auto Mode is the closest match. If you manage node pools yourself on GKE Standard, use managed node groups or Karpenter. Karpenter picks the right instance type for each workload, which often saves money and makes Spot much safer.</li></ul><p>One difference from Autopilot: EKS Auto Mode replaces every node after at most 21 days. Your workloads must be fine with nodes coming and going. Storage classes change too: GCE Persistent Disk volumes become EBS volumes through the EBS CSI driver.</p><ul><li><strong>Pod identity</strong> — GKE: Workload Identity Federation; EKS: EKS Pod Identity (or IRSA)</li><li><strong>Pod IPs</strong> — GKE: Separate IP ranges from nodes; EKS: Pods take IPs from the node’s subnet</li><li><strong>Ingress</strong> — GKE: GKE Ingress / Gateway creates Google LBs; EKS: AWS Load Balancer Controller creates ALBs / NLBs</li><li><strong>Node autoscaling</strong> — GKE: Cluster autoscaler, node auto-provisioning; EKS: Karpenter, or built in with Auto Mode</li><li><strong>Fully managed nodes</strong> — GKE: Autopilot; EKS: EKS Auto Mode (21-day max node life)</li><li><strong>Disks for pods</strong> — GKE: GCE PD CSI driver; EKS: EBS CSI driver</li><li><strong>Control plane cost</strong> — GKE: Cluster fee, with a monthly free credit; EKS: $0.10 per cluster per hour (standard support)</li></ul><blockquote><strong><em>Plan the subnets first.</em></strong><em> Running out of pod IPs is the most common EKS surprise for teams coming from GKE, and it’s much easier to fix before the cluster exists.</em></blockquote><h3>GPUs Move, TPUs Don’t</h3><p>GPU workloads move fairly easily. Both clouds use the same NVIDIA chips, so CUDA code doesn’t change:</p><ul><li><strong>A2</strong> — GPU: NVIDIA A100; AWS instance: P4d / P4de</li><li><strong>A3</strong> — GPU: NVIDIA H100 / H200; AWS instance: P5 / P5e / P5en</li><li><strong>A4</strong> — GPU: NVIDIA B200; AWS instance: P6-B200</li><li><strong>G2</strong> — GPU: NVIDIA L4; AWS instance: G6</li><li><strong>Cloud TPU</strong> — GPU: TPU; AWS instance: No match: GPUs, or Trainium / Inferentia</li></ul><p>The hard part is getting the machines. New AWS accounts start with low GPU limits, so ask for more weeks ahead. If you need many GPUs for a fixed period, look at Capacity Blocks for ML.</p><p>TPUs are different. AWS has no TPU, so TPU code has to be changed, not just moved. JAX and PyTorch/XLA models can run on GPUs with some work. AWS’s own chips (Trainium for training, Inferentia for serving) can cost less, but they need the Neuron SDK and testing for each model. Treat this as its own engineering project.</p><h3>Batch Jobs</h3><p>GCP Batch becomes <strong>AWS Batch</strong>. Both take a job, put it in a queue, and run it on machines they create for you. AWS Batch can run on EC2 (normal or Spot), on Fargate, or on EKS. For long jobs that can be stopped, run them on Spot with several instance types and save progress along the way (checkpoints), so a lost machine costs minutes, not hours. Retry settings are not the same on both sides, so set them on purpose.</p><h3>Networking You’ll Trip Over</h3><p>Networking isn’t compute, but it’s where compute moves go wrong:</p><ul><li><strong>VPCs are regional on AWS.</strong> One global VPC on GCP becomes one VPC per region, joined with Transit Gateway or peering.</li><li><strong>Subnets live in one zone.</strong> On GCP a subnet covers the whole region. On AWS each subnet is in one Availability Zone, so you need one per zone.</li><li><strong>Firewall rules become security groups.</strong> GCP firewall rules use network tags. AWS security groups are attached to each machine and can point at other security groups, which is cleaner but means rewriting every rule.</li><li><strong>Traffic between zones costs money.</strong> On AWS, data that crosses Availability Zones and NAT Gateway traffic are charged per GB. Keep chatty services in the same zone where you can.</li></ul><h3>A Simple Way to Decide</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VGHuqXIEDiaaXOZF.png" /></figure><p>For each workload, ask these questions in order and stop at the first yes:</p><ol><li><strong>Does it need TPUs?</strong> Plan the move to GPUs or Trainium before anything else.</li><li><strong>Is it on Kubernetes, and does the team want to keep it there?</strong> EKS (Auto Mode if you were on Autopilot).</li><li><strong>Is it batch work that can be stopped and restarted?</strong> AWS Batch on Spot.</li><li><strong>Does it need per-core licences or dedicated hardware?</strong> EC2 Dedicated Hosts, or licence-included EC2.</li><li><strong>Is it small, stateless and request-driven?</strong> It may not need a VM at all. See the Serverless post.</li><li><strong>Everything else:</strong> EC2 in an Auto Scaling group, sized from real usage.</li></ol><h3>What Changes on the Bill</h3><p>Most cost surprises come from discounts, not list prices.</p><ul><li><strong>Automatic discounts</strong> — GCP: Sustained use discounts on some series (N1, N2, N2D, C2, M1, M2); AWS: None; you pay the list price all month</li><li><strong>Commitments</strong> — GCP: Committed use discounts; AWS: Savings Plans and Reserved Instances</li><li><strong>Billing unit</strong> — GCP: Per second (1-minute minimum); AWS: Per second for Linux (1-minute minimum)</li><li><strong>Spot pricing</strong> — GCP: Fixed discount, changes at most monthly; AWS: Changes by instance type and zone</li><li><strong>Managed Kubernetes</strong> — GCP: Cluster fee, with a monthly free credit; AWS: $0.10 per cluster per hour</li><li><strong>Network</strong> — GCP: Premium global network by default; AWS: Cross-zone traffic and NAT Gateway charged per GB</li></ul><p>The discount that quietly disappears is the <strong>sustained use discount</strong>. On GCP, a VM that runs most of the month gets up to 30% off automatically. AWS has no such thing. You only get that money back by buying a Savings Plan.</p><p>Don’t buy one in the first weeks. Run on normal pricing until usage is steady, then commit to the amount you’re sure you’ll use. A Compute Savings Plan also covers EKS nodes, Fargate and Lambda, so you don’t have to commit to one instance family.</p><h3>What It Looks Like in Terraform</h3><p>A regional managed instance group becomes a launch template plus an Auto Scaling group:</p><pre># GCP: a group of 3 identical VMs across zones<br>resource &quot;google_compute_region_instance_group_manager&quot; &quot;web&quot; {<br>  name               = &quot;web&quot;<br>  base_instance_name = &quot;web&quot;<br>  region             = &quot;us-central1&quot;<br>  target_size        = 3<br>  version { instance_template = google_compute_instance_template.web.id }<br>}<br> <br># AWS: the same group as an Auto Scaling group<br>resource &quot;aws_autoscaling_group&quot; &quot;web&quot; {<br>  name                = &quot;web&quot;<br>  desired_capacity    = 3<br>  min_size            = 3<br>  max_size            = 6<br>  vpc_zone_identifier = var.private_subnet_ids # one subnet per zone<br>  health_check_type   = &quot;ELB&quot;                  # use the load balancer&#39;s check<br>  launch_template {<br>    id      = aws_launch_template.web.id<br>    version = &quot;$Latest&quot;<br>  }<br>}</pre><p>A group that uses Spot should list several instance types. Inside the aws_autoscaling_group, replace the launch_template block with:</p><pre>mixed_instances_policy {<br>  instances_distribution {<br>    on_demand_base_capacity                  = 1  # always keep one normal VM<br>    on_demand_percentage_above_base_capacity = 0  # the rest on Spot<br>    spot_allocation_strategy                 = &quot;price-capacity-optimized&quot;<br>  }<br>  launch_template {<br>    launch_template_specification { launch_template_id = aws_launch_template.web.id }<br>    override { instance_type = &quot;m7i.large&quot; }<br>    override { instance_type = &quot;m7a.large&quot; }<br>    override { instance_type = &quot;m6i.large&quot; }<br>  }<br>}</pre><p>These snippets show the shape, not every setting. Check the current provider docs before you copy them.</p><h3>Things That Bite Later</h3><ul><li><strong>Service account keys.</strong> Every VM service account becomes an IAM role, and every key file hidden in a script needs a new home.</li><li><strong>Metadata calls.</strong> Code that calls metadata.google.internal for project, zone or tokens must switch to IMDSv2 or the AWS SDK.</li><li><strong>Limits.</strong> New AWS accounts start with low limits for vCPUs, GPUs and Elastic IPs. Ask for more weeks ahead.</li><li><strong>AMI IDs differ per region.</strong> Look them up per region, or use SSM parameters, instead of hard-coding them.</li><li><strong>Single-zone setups.</strong> Check that every Auto Scaling group and node group covers at least two Availability Zones.</li><li><strong>Monitoring and logs.</strong> Cloud Monitoring and Cloud Logging agents become the CloudWatch agent. Rebuild alerts and dashboards before you switch traffic.</li></ul><h3>Doing the Move, Step by Step</h3><ol><li><strong>List everything.</strong> Every VM, instance group, cluster and batch job, with its machine type, real usage and what it talks to.</li><li><strong>Pick the target</strong> for each one using the questions above. Write down why, so you can revisit it later.</li><li><strong>Build the base:</strong> AWS accounts, VPCs, subnets big enough for EKS, IAM roles, limits and a private link to GCP.</li><li><strong>Start with a pilot.</strong> Move one small, low-risk service end to end to prove the path works.</li><li><strong>Move in waves.</strong> Stateless groups and clusters first, then rehost the harder servers with MGN.</li><li><strong>Shift traffic slowly</strong> with weighted DNS, and keep GCP running until AWS is steady.</li><li><strong>Clean up.</strong> Turn off GCP group by group, and buy Savings Plans only once AWS usage is steady.</li></ol><p>Compute is usually the easy part of a cloud move. The service map fits on one page. The real work is in the details: machine sizes, maintenance, Spot, pod IPs, identity and discounts. Decide those on purpose and the rest is mostly typing.</p><h3>Common Questions</h3><h3>Compute Engine vs EC2: what is actually different?</h3><p>The machines are close matches. Two things don’t carry over: EC2 has no custom machine types, so you round up to the next fixed size, and EC2 has no live migration, so maintenance can mean a stop and start. The Google guest agent, startup scripts and metadata server are replaced by SSM Agent, user data and IMDSv2.</p><h3>How do I map GCP machine types to EC2 instance types?</h3><p>Match by job first, then by vCPU, memory and clock speed, not by name. E2 maps to t3 or t4g, N2 and N2D to m7i or m7a, C3 and C4 to c7i or c8i, M-series to r8i or x2iedn, and Arm machines like Axion to Graviton (m8g, c8g). Size from what the VM really uses, not from its old shape.</p><h3>How do I migrate a VM from GCP to AWS step by step?</h3><p>Either copy it or rebuild it. AWS Transform MGN (formerly AWS Application Migration Service) installs an agent on the GCP VM, keeps the disks in sync with AWS, and lets you switch over in minutes. If the VM is built from code with Packer or Ansible, build an AMI instead and run it in an Auto Scaling group.</p><h3>What is the GKE to EKS migration checklist?</h3><p>Your manifests and Helm charts mostly move as they are. Plan four things: bigger subnets (every pod takes a VPC IP), Workload Identity to EKS Pod Identity, GKE Ingress to the AWS Load Balancer Controller, and nodes (EKS Auto Mode for Autopilot, managed node groups or Karpenter for GKE Standard). Swap the GCE PD CSI driver for the EBS CSI driver.</p><h3>Is there a TPU equivalent on AWS?</h3><p>No. TPU code has to be changed, not just moved. JAX and PyTorch/XLA models can run on NVIDIA GPUs with some work, or on AWS Trainium and Inferentia through the Neuron SDK. Treat it as its own project.</p><h3>What replaces GCP sustained use discounts on AWS?</h3><p>Nothing automatic. On AWS you get that saving back by buying a Compute Savings Plan, which also covers EKS nodes, Fargate and Lambda. Wait until usage is steady before you commit.</p><h3>About MigrateX</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/0*M8nzTBJCZq2YDAQG.png" /></figure><p>MigrateX is our platform and service for moving software, data and infrastructure from one technology to another. It combines automation with experienced engineers. The automation does the repetitive work quickly, and the engineers make the tricky decisions.</p><p>This guide is how we approach GCP to AWS compute moves with MigrateX. Here’s what that looks like:</p><ol><li><strong>Assessment.</strong> We list every VM, instance group, GKE cluster, GPU machine and batch job, with real usage, dependencies, licences and the hidden ties to GCP, like metadata calls and service account keys. You see where the work is before anyone agrees on a timeline.</li><li><strong>Plan.</strong> We work with your team to pick the AWS target for each workload, right-size the machines, design the network and accounts, and decide the order of the waves.</li><li><strong>Migration, step by step.</strong> Automation does the repetitive parts, like turning Terraform and instance templates into launch templates, Auto Scaling groups and EKS setups, and replicating servers with MGN. Our engineers handle the parts that need thought: identity, networking, Spot design and TPU code.</li><li><strong>Proof that it works.</strong> Each workload runs on both clouds side by side. We compare health, speed and cost, and only shift traffic once AWS matches or beats GCP.</li><li><strong>Handover and clean-up.</strong> We turn off GCP group by group, set up Savings Plans once usage is steady, and leave your team with AWS infrastructure they understand and own.</li></ol><p><strong>What you get along the way:</strong></p><ul><li><strong>No big switch-over weekend.</strong> Your services keep running while the move happens one wave at a time.</li><li><strong>Less risk.</strong> Side-by-side runs and slow traffic shifts mean you can always switch back.</li><li><strong>A smaller bill, not a bigger one.</strong> Right-sizing, Spot and Savings Plans are part of the move, not an afterthought.</li><li><strong>More than one kind of move.</strong> We use the same approach for storage, serverless and big data, and for front ends like Angular, Ember and jQuery.</li></ul><blockquote><em>Planning a move from GCP to AWS? We’d love to hear about it. Tell us a little about your setup through </em><a href="https://cobuildx.ai/contact"><em>Contact Us</em></a><em>, and we’ll start with a free chat about where the work is likely to be.</em></blockquote><h3>AWS</h3><ul><li>AWS. <em>What is AWS Transform MGN?</em> <a href="https://docs.aws.amazon.com/mgn/latest/ug/what-is-application-migration-service.html">https://docs.aws.amazon.com/mgn/latest/ug/what-is-application-migration-service.html</a></li><li>AWS. <em>Spot Instance interruption notices</em>. <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-instance-termination-notices.html">https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-instance-termination-notices.html</a></li><li>AWS. <em>Amazon EKS Auto Mode</em>. <a href="https://docs.aws.amazon.com/eks/latest/userguide/automode.html">https://docs.aws.amazon.com/eks/latest/userguide/automode.html</a></li><li>AWS. <em>Amazon EKS pricing</em>. <a href="https://aws.amazon.com/eks/pricing/">https://aws.amazon.com/eks/pricing/</a></li><li>AWS. <em>Compute Savings Plans</em>. <a href="https://aws.amazon.com/savingsplans/compute-pricing/">https://aws.amazon.com/savingsplans/compute-pricing/</a></li><li>AWS. <em>Amazon EC2 Dedicated Hosts</em>. <a href="https://aws.amazon.com/ec2/dedicated-hosts/">https://aws.amazon.com/ec2/dedicated-hosts/</a></li><li>AWS. <em>AWS Batch</em>. <a href="https://aws.amazon.com/batch/">https://aws.amazon.com/batch/</a></li></ul><h3>Google Cloud</h3><ul><li>Google Cloud. <em>Spot VMs</em>. <a href="https://docs.cloud.google.com/compute/docs/instances/spot">https://docs.cloud.google.com/compute/docs/instances/spot</a></li><li>Google Cloud. <em>Sustained use discounts</em>. <a href="https://docs.cloud.google.com/compute/docs/sustained-use-discounts">https://docs.cloud.google.com/compute/docs/sustained-use-discounts</a></li><li>Google Cloud. <em>GKE pricing</em>. <a href="https://cloud.google.com/kubernetes-engine/pricing">https://cloud.google.com/kubernetes-engine/pricing</a></li></ul><p><em>Originally published at </em><a href="https://cobuildx.ai/blog/gcp-to-aws-compute-options"><em>cobuildx.ai/blog/gcp-to-aws-compute-options</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eccac7e40df9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Moving Storage from GCP to AWS: Cloud Storage, Disks and File Shares]]></title>
            <link>https://medium.com/@cobuildx.ai/moving-storage-from-gcp-to-aws-cloud-storage-disks-and-file-shares-9361cef3b992?source=rss-f6d64156316d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9361cef3b992</guid>
            <category><![CDATA[amazon-s3]]></category>
            <category><![CDATA[cloud-migration]]></category>
            <category><![CDATA[cloud-storage]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[CobuildX AI]]></dc:creator>
            <pubDate>Wed, 28 Oct 2026 12:14:02 GMT</pubDate>
            <atom:updated>2026-10-28T12:14:02.455Z</atom:updated>
            <content:encoded><![CDATA[<h4>A plain-English guide to moving storage from Google Cloud to AWS: Cloud Storage, Persistent Disk, Filestore, backups and transfer tools. What replaces what, how storage classes and access change, how to copy the data safely, what changes on the bill, and a step-by-step plan.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EYhvyETAH7TmuerX.png" /></figure><p>Every app keeps data somewhere. Photos that users upload. Disks that servers run on. Folders that many machines share. Backups. Records that must be kept for years. All of this is “storage”. When you move from Google Cloud (GCP) to AWS, storage is often the biggest thing to carry across.</p><p>On GCP, storage means three main things:</p><ul><li><strong>Cloud Storage</strong> keeps files in buckets. A bucket is like a big folder in the cloud. Each file in it is called an object.</li><li><strong>Persistent Disk and Hyperdisk</strong> are the hard drives attached to virtual machines.</li><li><strong>Filestore</strong> is a shared folder that many machines can use at the same time.</li></ul><p>Around these sit backups and tools for copying data.</p><p>Storage looks easy to move. A bucket is a bucket. But the details are different. The cheap “cold” storage works in a different way. Access rules are written in a different way. And copying many terabytes takes time and money. On top of that, every file must arrive whole. Not one file can be lost or changed.</p><blockquote><em>“S3 is effectively a living, breathing organism.”</em></blockquote><blockquote><em>— </em><strong><em>Andy Warfield</em></strong><em>, VP and Distinguished Engineer at Amazon S3, in </em><a href="https://www.allthingsdistributed.com/2023/07/building-and-operating-a-pretty-big-storage-system.html">Building and operating a pretty big storage system called S3</a></blockquote><p>That is a good way to think about the move. You are not just dropping files into a box. You are moving into a service with its own habits. This guide covers:</p><ul><li>Which AWS service replaces each GCP storage service</li><li>What works differently on AWS</li><li>How to copy the data safely</li><li>What changes on the bill</li><li>A simple step-by-step plan</li></ul><h3>The Quick Map</h3><p>Here is each GCP storage service and its closest match on AWS. The rest of the post explains each row.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ca5arMSk0YUb0fCC.png" /></figure><ul><li><strong>Cloud Storage</strong> — Closest AWS match: <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html">Amazon S3</a>; Watch out for: Cold storage works differently</li><li><strong>Autoclass</strong> — Closest AWS match: <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/intelligent-tiering.html">S3 Intelligent-Tiering</a>; Watch out for: Very small files are not moved to cheaper tiers</li><li><strong>Persistent Disk / Hyperdisk</strong> — Closest AWS match: <a href="https://docs.aws.amazon.com/ebs/latest/userguide/what-is-ebs.html">Amazon EBS</a>; Watch out for: You set disk speed yourself</li><li><strong>Regional Persistent Disk</strong> — Closest AWS match: No direct match; Watch out for: An EBS disk lives in one data center</li><li><strong>Local SSD</strong> — Closest AWS match: EC2 instance store; Watch out for: Data is lost when the machine stops</li><li><strong>Filestore</strong> — Closest AWS match: <a href="https://docs.aws.amazon.com/efs/latest/ug/whatisefs.html">Amazon EFS</a>, or Amazon FSx; Watch out for: Pick by how the folder is shared</li><li><strong>Google Cloud NetApp Volumes</strong> — Closest AWS match: <a href="https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/what-is-fsx-ontap.html">Amazon FSx for NetApp ONTAP</a>; Watch out for: Same NetApp tools on both sides</li><li><strong>Backup and DR Service</strong> — Closest AWS match: <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html">AWS Backup</a>; Watch out for: Backup plans are set up again, not copied</li><li><strong>Storage Transfer Service</strong> — Closest AWS match: <a href="https://docs.aws.amazon.com/datasync/latest/userguide/tutorial_transfer-google-cloud-storage.html">AWS DataSync</a>; Watch out for: DataSync can read Cloud Storage directly</li><li><strong>Transfer Appliance</strong> — Closest AWS match: Copy over the network with DataSync; Watch out for: Snowball is closed to new customers</li></ul><blockquote><strong><em>What about Snowball?</em></strong><em> Snowball was AWS’s way to ship large amounts of data on a physical device. But AWS </em><a href="https://docs.aws.amazon.com/snowball/latest/developer-guide/snowball-edge-availability-change.html"><em>stopped offering Snowball Edge to new customers on November 7, 2025</em></a><em>. For a move from one cloud to another, copying over the network is the normal path anyway.</em></blockquote><h3>Cloud Storage to Amazon S3</h3><p>Cloud Storage and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html">Amazon S3</a> work the same basic way. You make buckets. You put files in them. Each file has a name, its data and a few labels (called metadata). Almost everything you do in one, you can do in the other.</p><p>Google even offers an <a href="https://cloud.google.com/storage/docs/interoperability">S3-style way to talk to Cloud Storage</a>. That is why many AWS tools can read your GCP buckets directly.</p><h3>Storage classes</h3><p>A storage class is a price plan for your files. Files you read often go in a normal class. Files you rarely read go in a cheaper “cold” class. You pay less to keep them, but more to read them.</p><p>Both clouds have these classes, and the names roughly line up. But there is one big difference. On GCP, every class gives your file back in milliseconds, even Archive. On AWS, the two coldest classes do not. You must first <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/restoring-objects.html">ask AWS to restore the file</a>, and that can take minutes or hours.</p><ul><li><strong>Standard</strong> — S3 class to use: S3 Standard; Shortest time you pay for: No minimum; How fast you can read it: Right away</li><li><strong>Nearline</strong> — S3 class to use: S3 Standard-IA; Shortest time you pay for: 30 days; How fast you can read it: Right away</li><li><strong>Coldline</strong> — S3 class to use: S3 Glacier Instant Retrieval; Shortest time you pay for: 90 days; How fast you can read it: Right away</li><li><strong>Archive</strong> — S3 class to use: S3 Glacier Instant Retrieval; Shortest time you pay for: 90 days; How fast you can read it: Right away</li><li><strong>Archive (if nobody needs it fast)</strong> — S3 class to use: S3 Glacier Deep Archive; Shortest time you pay for: 180 days; How fast you can read it: Hours, after a restore</li><li><strong>Autoclass</strong> — S3 class to use: S3 Intelligent-Tiering; Shortest time you pay for: No minimum; How fast you can read it: Right away</li></ul><p>These numbers come from the <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html">S3 storage class guide</a>. One more thing to know: in S3 Standard-IA and Glacier Instant Retrieval, every file is billed as if it were at least 128 KB. If you have millions of tiny files, a cold class can cost more, not less.</p><blockquote><strong><em>Rule of thumb:</em></strong><em> if an app still reads old files, move Archive to Glacier Instant Retrieval. Use Deep Archive only for files nobody needs in a hurry, like old backups and legal copies.</em></blockquote><h3>Bucket settings</h3><p>Most bucket settings have a direct match on AWS. They just have new names:</p><ul><li><strong>Lifecycle rules (move or delete old files)</strong> — Amazon S3: <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html">S3 Lifecycle</a></li><li><strong>Object versioning (keep old copies)</strong> — Amazon S3: S3 Versioning</li><li><strong>Dual-region and multi-region buckets</strong> — Amazon S3: A bucket in one region, plus <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html">S3 Replication</a> if you need a second copy</li><li><strong>Retention lock (files can’t be deleted)</strong> — Amazon S3: <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html">S3 Object Lock</a></li><li><strong>Your own encryption keys (Cloud KMS)</strong> — Amazon S3: <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html">Encryption with AWS KMS keys</a></li><li><strong>Pub/Sub notifications when a file changes</strong> — Amazon S3: <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventNotifications.html">S3 Event Notifications</a></li><li><strong>Signed URLs (short-lived download links)</strong> — Amazon S3: <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html">Pre-signed URLs</a></li><li><strong>gcloud storage command line</strong> — Amazon S3: aws s3 command line</li></ul><h3>Who can read and write</h3><p>On GCP, most teams give people and apps a role on the bucket, like “Storage Object Viewer”. On AWS, access comes from two places. IAM policies say what a user or app may do. A bucket policy says who may use the bucket.</p><p>Leave <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html">Block Public Access</a> turned on. It stops a bucket from being opened to the whole internet by mistake. New buckets have it on by default. If files really must be public, like images on a website, serve them through CloudFront instead of opening the bucket.</p><h3>Disks: Persistent Disk to EBS</h3><p>Disks for virtual machines move to <a href="https://docs.aws.amazon.com/ebs/latest/userguide/what-is-ebs.html">Amazon EBS</a>. The main change is how speed works.</p><p>Disk speed is measured in IOPS: how many reads and writes the disk can do each second. On GCP, a bigger disk is often a faster disk. On AWS, the usual disk type (gp3) <a href="https://docs.aws.amazon.com/ebs/latest/userguide/general-purpose.html">lets you choose the speed on its own</a>. Every gp3 disk starts at 3,000 IOPS, and you pay extra to go higher.</p><ul><li><strong>pd-standard</strong> — EBS disk: st1 (hard drive), or gp3; Good for: Big files read from start to end</li><li><strong>pd-balanced</strong> — EBS disk: gp3; Good for: Most apps</li><li><strong>pd-ssd</strong> — EBS disk: gp3 with more IOPS; Good for: Busy databases</li><li><strong>pd-extreme, Hyperdisk Extreme</strong> — EBS disk: io2; Good for: Very busy databases</li></ul><p>Two GCP disks have no exact match:</p><ul><li><strong>Regional Persistent Disk</strong> keeps a copy of the disk in two zones (two separate data centers). An EBS disk lives in one zone. On AWS, you get the same safety another way: a database copy in a second zone, or regular snapshots.</li><li><strong>Local SSD</strong> becomes EC2 instance store. The warning is the same on both clouds: the data is gone when the machine stops. Use it only for data you can rebuild.</li></ul><p>Disks usually move together with their machines. <a href="https://docs.aws.amazon.com/mgn/latest/ug/what-is-application-migration-service.html">AWS Application Migration Service</a> copies a running machine and its disks to AWS, and keeps them in sync until you switch.</p><h3>Shared Folders: Filestore to EFS or FSx</h3><p>Filestore gives many machines one shared folder. Machines reach it over the network using NFS, a common way to share folders on Linux. AWS has a few choices. Pick by what your apps need:</p><ul><li><a href="https://docs.aws.amazon.com/efs/latest/ug/whatisefs.html"><strong>Amazon EFS</strong></a> is the simple match for most Filestore use. It uses NFS. It grows and shrinks on its own, so you never pick a size. It keeps your data in several zones. You pay for what you store.</li><li><a href="https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/what-is-fsx-ontap.html"><strong>Amazon FSx for NetApp ONTAP</strong></a> fits apps that need both Linux and Windows sharing, or NetApp features like instant copies. It is also the direct match for Google Cloud NetApp Volumes.</li><li><a href="https://docs.aws.amazon.com/fsx/latest/LustreGuide/what-is.html"><strong>Amazon FSx for Lustre</strong></a> is for very heavy work, like training AI models. It can read files straight from S3.</li><li><a href="https://docs.aws.amazon.com/fsx/latest/WindowsGuide/what-is.html"><strong>Amazon FSx for Windows File Server</strong></a> is for Windows apps.</li></ul><p>One tip: EFS is fast when many machines read at once, but each small file takes a little time to open. Apps that open thousands of tiny files one by one can feel slower. Test with your real app before you decide.</p><h3>Moving the Data</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NP6AzgeH-DeiNOUC.png" /></figure><p>For buckets, the best tool is <a href="https://docs.aws.amazon.com/datasync/latest/userguide/tutorial_transfer-google-cloud-storage.html">AWS DataSync</a>. It reads Cloud Storage directly. You give it a key from GCP, and it copies files into S3. For bucket to bucket copies, you don’t need to install anything on GCP.</p><p>DataSync also checks every file after it copies it. On later runs, it only copies what changed. And it writes a report, so you can prove what was moved.</p><p>For Filestore, DataSync needs a small helper machine (an “agent”) running on GCP, close to the data. For disks, move the whole machine with Application Migration Service.</p><p>A safe copy follows the same steps every time:</p><ol><li><strong>First full copy</strong> while the old system keeps running. For big buckets, this can take days.</li><li><strong>Catch-up copies</strong> that only move what changed. Each one is shorter than the last.</li><li><strong>Final copy.</strong> Stop writes for a short time, run one last copy, then point your apps at AWS.</li><li><strong>Check everything.</strong> Compare the number of files, their sizes and their checksums. A checksum is like a fingerprint of a file. If the fingerprints match, the file arrived unchanged.</li></ol><blockquote><em>“These are simple mechanisms that protect you from a large class of risks.”</em></blockquote><blockquote><em>— </em><strong><em>Andy Warfield</em></strong><em>, VP and Distinguished Engineer at Amazon S3, in </em><a href="https://www.allthingsdistributed.com/2023/07/building-and-operating-a-pretty-big-storage-system.html">Building and operating a pretty big storage system called S3</a></blockquote><p>Checks are simple too, and they are what make a move safe. Don’t delete anything on GCP until they pass.</p><blockquote><strong><em>Ask about Google’s exit offer.</em></strong><em> Data leaving GCP normally costs money for every GB. Google offers </em><a href="https://cloud.google.com/exit-cloud"><em>free data transfer for customers who leave Google Cloud</em></a><em>. You must apply first, and there are rules. Talk to your Google account team before the big copy starts.</em></blockquote><h3>A Simple Way to Decide</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rFtpgzTFD_e2CsqY.png" /></figure><ol><li><strong>Is it files in a bucket?</strong> Use S3. Pick the class by how often the files are read. If you don’t know, use Intelligent-Tiering.</li><li><strong>Is it a disk for one machine?</strong> Use EBS gp3. Use io2 only for the busiest databases.</li><li><strong>Do many machines share one folder?</strong> Use EFS. Use FSx if you need Windows sharing, NetApp features or very heavy work.</li><li><strong>Is it a backup?</strong> Use <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html">AWS Backup</a>. Keep a copy in a separate AWS account, so one mistake can’t delete both.</li></ol><h3>What Changes on the Bill</h3><p>Storage prices look simple: a price for each GB, each month. The surprises come from everything around that:</p><ul><li><strong>Keeping files</strong> — GCP: Per GB per month, by class; AWS: <a href="https://aws.amazon.com/s3/pricing/">S3</a>: per GB per month, by class</li><li><strong>Reading and writing</strong> — GCP: A fee per 1,000 actions; AWS: A fee per 1,000 requests; higher for cold classes</li><li><strong>Reading cold files</strong> — GCP: A fee per GB; AWS: A fee per GB, and a wait for Glacier</li><li><strong>Deleting too early</strong> — GCP: You pay the minimum time; AWS: You pay the minimum time, and for at least 128 KB per file</li><li><strong>Disks</strong> — GCP: Per GB; speed comes with size; AWS: <a href="https://aws.amazon.com/ebs/pricing/">EBS</a>: per GB, plus extra speed if you want it</li><li><strong>Shared folders</strong> — GCP: Filestore: for the size you set aside; AWS: <a href="https://aws.amazon.com/efs/pricing/">EFS</a>: for what you actually store</li><li><strong>Data leaving the cloud</strong> — GCP: Per GB; AWS: Per GB</li></ul><p>Three things catch teams out:</p><ul><li><strong>Lots of tiny files.</strong> Request fees and the 128 KB minimum add up fast. Bundle small files together, or keep them in S3 Standard.</li><li><strong>Copying lifecycle rules as they are.</strong> A rule that moves files to a cold class is cheap on GCP. On AWS, moving millions of small files into Glacier costs a fee for each one.</li><li><strong>NAT gateways.</strong> Machines in a private network often reach S3 through a NAT gateway, which charges for every GB. Add a free <a href="https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints-s3.html">S3 gateway endpoint</a> instead.</li></ul><p>Turn on <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens.html">S3 Storage Lens</a> early. It shows which buckets are growing, which files nobody reads, and where a lifecycle rule would save money.</p><h3>What It Looks Like in Code</h3><p>Uploading a file and making a one-hour download link, on GCP and on AWS:</p><pre># GCP: Cloud Storage (Python)<br>from datetime import timedelta<br>from google.cloud import storage<br> <br>bucket = storage.Client().bucket(&quot;shop-invoices&quot;)<br>blob = bucket.blob(&quot;2026/10/inv-1042.pdf&quot;)<br>blob.upload_from_filename(&quot;inv-1042.pdf&quot;)<br>url = blob.generate_signed_url(https://medium.com/expiration=timedelta(hours=1))<br> <br># AWS: Amazon S3 (Python)<br>import boto3<br> <br>s3 = boto3.client(&quot;s3&quot;)<br>s3.upload_file(&quot;inv-1042.pdf&quot;, &quot;shop-invoices&quot;, &quot;2026/10/inv-1042.pdf&quot;)<br>url = s3.generate_presigned_url(https://medium.com/%3Cbr%3E%20%20%20%20&quot;get_object&quot;,%3Cbr%3E%20%20%20%20Params=%7B&quot;Bucket&quot;:%20&quot;shop-invoices&quot;,%20&quot;Key&quot;:%20&quot;2026/10/inv-1042.pdf&quot;%7D,%3Cbr%3E%20%20%20%20ExpiresIn=3600,%3Cbr%3E)</pre><p>And a bucket that keeps old versions and moves files to a cold class after 90 days, in Terraform:</p><pre># GCP: a Cloud Storage bucket<br>resource &quot;google_storage_bucket&quot; &quot;invoices&quot; {<br>  name                        = &quot;shop-invoices&quot;<br>  location                    = &quot;US-CENTRAL1&quot;<br>  uniform_bucket_level_access = true<br>  versioning { enabled = true }<br>  lifecycle_rule {<br>    condition { age = 90 }<br>    action {<br>      type          = &quot;SetStorageClass&quot;<br>      storage_class = &quot;COLDLINE&quot;<br>    }<br>  }<br>}<br> <br># AWS: the same bucket in S3 (each setting is its own resource)<br>resource &quot;aws_s3_bucket&quot; &quot;invoices&quot; {<br>  bucket = &quot;shop-invoices&quot;   # names are global; it may be taken<br>}<br> <br>resource &quot;aws_s3_bucket_versioning&quot; &quot;invoices&quot; {<br>  bucket = aws_s3_bucket.invoices.id<br>  versioning_configuration { status = &quot;Enabled&quot; }<br>}<br> <br>resource &quot;aws_s3_bucket_lifecycle_configuration&quot; &quot;invoices&quot; {<br>  bucket = aws_s3_bucket.invoices.id<br>  rule {<br>    id     = &quot;cold-after-90-days&quot;<br>    status = &quot;Enabled&quot;<br>    filter {}<br>    transition {<br>      days          = 90<br>      storage_class = &quot;GLACIER_IR&quot;   # was COLDLINE<br>    }<br>  }<br>}</pre><p>These snippets show the shape, not every setting. Check the current docs before you copy them.</p><h3>Things That Bite Later</h3><blockquote><em>“Failures are a given and everything will eventually fail over time.”</em></blockquote><blockquote><em>— </em><strong><em>Werner Vogels</em></strong><em>, CTO of Amazon, in </em><a href="https://www.allthingsdistributed.com/2016/03/10-lessons-from-10-years-of-aws.html">10 Lessons from 10 Years of AWS</a></blockquote><p>These are the small things that tend to break after the move:</p><ul><li><strong>Old file paths.</strong> Paths like gs://bucket/file and links to storage.googleapis.com hide in code, settings, scripts and database rows. Search for all of them, including links you have already sent to customers.</li><li><strong>Bucket names.</strong> Bucket names must be unique across all of AWS. The name you used on GCP may already be taken. Choose names early.</li><li><strong>File labels.</strong> Labels like Content-Type tell a browser what a file is. If they are not copied, a browser may download a picture instead of showing it.</li><li><strong>Cold files that need a restore.</strong> Code that reads from Archive on GCP will fail on Glacier Deep Archive until the file is restored.</li><li><strong>Sudden heavy traffic.</strong> S3 handles <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/optimizing-performance.html">thousands of requests per second</a> and grows over time. But a brand-new bucket hit hard on day one can slow down at first. Ramp up traffic step by step.</li><li><strong>File change alerts.</strong> If apps react when a file is added, those alerts move to <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventNotifications.html">S3 Event Notifications</a>. The alert looks different, so the code that reads it needs a small change.</li></ul><h3>Doing the Move, Step by Step</h3><ol><li><strong>List everything.</strong> Every bucket, disk, shared folder and backup, with its size, number of files, class, cost, owner and the apps that use it.</li><li><strong>Pick the AWS service</strong> and storage class for each one, using the questions above. Write down why.</li><li><strong>Set up the base:</strong> AWS accounts, networks, S3 gateway endpoints, encryption keys in <a href="https://docs.aws.amazon.com/kms/latest/developerguide/overview.html">AWS KMS</a>, access rules and backup plans.</li><li><strong>Apply for Google’s exit offer</strong> before the big copy starts.</li><li><strong>Start with one bucket.</strong> Copy it with DataSync, check it, and point one app at it.</li><li><strong>Move the rest in waves.</strong> For each wave: full copy, catch-up copies, a short freeze, a final copy, then checks.</li><li><strong>Clean up.</strong> Keep the GCP data read-only for a while, then delete it. Remove old keys and accounts. Review the AWS bill after the first full month.</li></ol><p>Storage is the heaviest part of a cloud move, but it is also the most predictable. The services match closely. The work is in the details: cold classes, access rules, tiny files and a careful final copy. Get those right, and your data arrives whole.</p><h3>Common Questions</h3><h3>How do I transfer data from GCS to S3?</h3><p>Use AWS DataSync. It reads Google Cloud Storage directly with a GCP key, so bucket-to-bucket copies need nothing installed on GCP. It checks every file, copies only what changed on later runs, and writes a report. Run a full copy, catch-up copies, then a short freeze and a final copy.</p><h3>Is Google Cloud Storage S3 compatible?</h3><p>Partly. Cloud Storage has an S3-style XML API, which is why DataSync, rclone and many S3 tools can read GCS buckets directly. Your apps still need small changes once they move to real S3, such as signed URLs becoming pre-signed URLs.</p><h3>Can I use rclone instead of DataSync for GCS to S3?</h3><p>For small buckets, yes. For large moves, DataSync is safer: it checks every file, retries, runs incremental syncs and gives you a report you can show auditors.</p><h3>What is the GCP Filestore equivalent in AWS?</h3><p>Amazon EFS for most NFS shares. Use FSx for NetApp ONTAP for mixed Linux and Windows sharing or NetApp features, FSx for Lustre for heavy AI and HPC work, and FSx for Windows File Server for Windows apps.</p><h3>Persistent Disk vs EBS: what is different?</h3><p>On GCP a bigger disk is a faster disk. On EBS gp3 you set speed on its own: every disk starts at 3,000 IOPS and you pay for more. pd-balanced maps to gp3, pd-ssd to gp3 with more IOPS, and pd-extreme to io2. Regional Persistent Disk has no direct match.</p><h3>Coldline vs Glacier: which S3 class replaces it?</h3><p>Coldline and Archive map to S3 Glacier Instant Retrieval if apps still read the files. Use Glacier Deep Archive only for files nobody needs fast, because it needs a restore that can take hours.</p><h3>How do I avoid GCP egress fees when moving to AWS?</h3><p>Apply for Google’s free data transfer for customers leaving Google Cloud before the big copy starts. Talk to your Google account team, since there are rules to follow.</p><h3>About MigrateX</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/0*Az7KQdPi2yc9BCss.png" /></figure><p>MigrateX is our platform and service for moving software, data and infrastructure from one technology to another. It combines automation with experienced engineers. The automation does the repetitive work quickly, and the engineers make the tricky decisions.</p><p>Here’s how we run a GCP to AWS storage move with MigrateX:</p><ol><li><strong>Assessment.</strong> We list every bucket, disk, shared folder and backup, with its size, file count, class, cost and owner. You see where the work is before anyone agrees on a timeline.</li><li><strong>Plan.</strong> We work with your team to pick the AWS service and storage class for each one, set up access and encryption, and plan the copy waves.</li><li><strong>Migration, step by step.</strong> Automation does the repetitive parts: setting up DataSync copies, turning lifecycle rules and bucket settings into their AWS versions, and updating gs:// paths and Terraform. Our engineers handle the parts that need thought: cold data, very large buckets, shared folders and the final switch.</li><li><strong>Proof that it works.</strong> Every wave ends with checks on file counts, sizes and checksums. Apps are tested against the new storage before the switch.</li><li><strong>Handover and clean-up.</strong> We retire GCP storage one wave at a time, tune storage classes once real usage is known, and leave your team with a setup they understand and own.</li></ol><p><strong>What you get along the way:</strong></p><ul><li><strong>No lost data.</strong> Every file is checked after it is copied. Nothing is deleted until the checks pass.</li><li><strong>Short freezes.</strong> Catch-up copies keep the final switch down to minutes or hours, not days.</li><li><strong>A smaller bill, not a bigger one.</strong> The right storage classes, lifecycle rules and endpoints are part of the move, not an afterthought.</li><li><strong>One team from start to end.</strong> The same people plan the move, copy the data and hand it over.</li></ul><blockquote><em>Planning a move from GCP to AWS? We’d love to hear about it. Tell us a little about your setup through </em><a href="https://cobuildx.ai/contact"><em>Contact Us</em></a><em>, and we’ll start with a free chat about where the work is likely to be.</em></blockquote><h3>AWS</h3><ul><li>AWS. <em>What is Amazon S3?</em> <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html">https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html</a></li><li>AWS. <em>Understanding and managing Amazon S3 storage classes</em>. <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html">https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html</a></li><li>AWS. <em>S3 Intelligent-Tiering</em>. <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/intelligent-tiering.html">https://docs.aws.amazon.com/AmazonS3/latest/userguide/intelligent-tiering.html</a></li><li>AWS. <em>Restoring an archived object</em>. <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/restoring-objects.html">https://docs.aws.amazon.com/AmazonS3/latest/userguide/restoring-objects.html</a></li><li>AWS. <em>Managing the lifecycle of objects</em>. <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html">https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html</a></li><li>AWS. <em>Replicating objects</em>. <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html">https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html</a></li><li>AWS. <em>S3 Object Lock</em>. <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html">https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html</a></li><li>AWS. <em>Using server-side encryption with AWS KMS keys</em>. <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html">https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html</a></li><li>AWS. <em>Amazon S3 Event Notifications</em>. <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventNotifications.html">https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventNotifications.html</a></li><li>AWS. <em>Blocking public access to your Amazon S3 storage</em>. <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html">https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html</a></li><li>AWS. <em>Sharing objects with presigned URLs</em>. <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html">https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html</a></li><li>AWS. <em>Optimizing Amazon S3 performance</em>. <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/optimizing-performance.html">https://docs.aws.amazon.com/AmazonS3/latest/userguide/optimizing-performance.html</a></li><li>AWS. <em>Amazon S3 Storage Lens</em>. <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens.html">https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens.html</a></li><li>AWS. <em>Gateway endpoints for Amazon S3</em>. <a href="https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints-s3.html">https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints-s3.html</a></li><li>AWS. <em>What is Amazon EBS?</em> <a href="https://docs.aws.amazon.com/ebs/latest/userguide/what-is-ebs.html">https://docs.aws.amazon.com/ebs/latest/userguide/what-is-ebs.html</a></li><li>AWS. <em>General Purpose SSD volumes</em>. <a href="https://docs.aws.amazon.com/ebs/latest/userguide/general-purpose.html">https://docs.aws.amazon.com/ebs/latest/userguide/general-purpose.html</a></li><li>AWS. <em>What is Amazon EFS?</em> <a href="https://docs.aws.amazon.com/efs/latest/ug/whatisefs.html">https://docs.aws.amazon.com/efs/latest/ug/whatisefs.html</a></li><li>AWS. <em>What is Amazon FSx for NetApp ONTAP?</em> <a href="https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/what-is-fsx-ontap.html">https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/what-is-fsx-ontap.html</a></li><li>AWS. <em>What is Amazon FSx for Lustre?</em> <a href="https://docs.aws.amazon.com/fsx/latest/LustreGuide/what-is.html">https://docs.aws.amazon.com/fsx/latest/LustreGuide/what-is.html</a></li><li>AWS. <em>What is Amazon FSx for Windows File Server?</em> <a href="https://docs.aws.amazon.com/fsx/latest/WindowsGuide/what-is.html">https://docs.aws.amazon.com/fsx/latest/WindowsGuide/what-is.html</a></li><li>AWS. <em>What is AWS Backup?</em> <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html">https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html</a></li><li>AWS. <em>AWS Key Management Service</em>. <a href="https://docs.aws.amazon.com/kms/latest/developerguide/overview.html">https://docs.aws.amazon.com/kms/latest/developerguide/overview.html</a></li><li>AWS. <em>What is AWS Application Migration Service?</em> <a href="https://docs.aws.amazon.com/mgn/latest/ug/what-is-application-migration-service.html">https://docs.aws.amazon.com/mgn/latest/ug/what-is-application-migration-service.html</a></li><li>AWS. <em>Configuring AWS DataSync transfers with Google Cloud Storage</em>. <a href="https://docs.aws.amazon.com/datasync/latest/userguide/tutorial_transfer-google-cloud-storage.html">https://docs.aws.amazon.com/datasync/latest/userguide/tutorial_transfer-google-cloud-storage.html</a></li><li>AWS. <em>AWS Snowball Edge availability change</em>. <a href="https://docs.aws.amazon.com/snowball/latest/developer-guide/snowball-edge-availability-change.html">https://docs.aws.amazon.com/snowball/latest/developer-guide/snowball-edge-availability-change.html</a></li></ul><h3>Expert sources</h3><ul><li>Andy Warfield. <em>Building and operating a pretty big storage system called S3</em>. All Things Distributed, 2023. <a href="https://www.allthingsdistributed.com/2023/07/building-and-operating-a-pretty-big-storage-system.html">https://www.allthingsdistributed.com/2023/07/building-and-operating-a-pretty-big-storage-system.html</a></li><li>Werner Vogels. <em>10 Lessons from 10 Years of Amazon Web Services</em>. All Things Distributed, 2016. <a href="https://www.allthingsdistributed.com/2016/03/10-lessons-from-10-years-of-aws.html">https://www.allthingsdistributed.com/2016/03/10-lessons-from-10-years-of-aws.html</a></li></ul><h3>Google Cloud</h3><ul><li>Google Cloud. <em>Storage classes</em>. <a href="https://cloud.google.com/storage/docs/storage-classes">https://cloud.google.com/storage/docs/storage-classes</a></li><li>Google Cloud. <em>Cloud Storage interoperability</em>. <a href="https://cloud.google.com/storage/docs/interoperability">https://cloud.google.com/storage/docs/interoperability</a></li><li>Google Cloud. <em>Exit Google Cloud</em>. <a href="https://cloud.google.com/exit-cloud">https://cloud.google.com/exit-cloud</a></li></ul><p><em>Originally published at </em><a href="https://cobuildx.ai/blog/gcp-to-aws-storage"><em>cobuildx.ai/blog/gcp-to-aws-storage</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9361cef3b992" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Moving Serverless from GCP to AWS: Cloud Run, Functions and Events]]></title>
            <link>https://medium.com/@cobuildx.ai/moving-serverless-from-gcp-to-aws-cloud-run-functions-and-events-c246373a19c4?source=rss-f6d64156316d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c246373a19c4</guid>
            <category><![CDATA[cloud-migration]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[CobuildX AI]]></dc:creator>
            <pubDate>Wed, 28 Oct 2026 12:13:39 GMT</pubDate>
            <atom:updated>2026-10-28T12:13:39.827Z</atom:updated>
            <content:encoded><![CDATA[<h4>A plain-English guide to moving serverless apps from Google Cloud to AWS: Cloud Run, Cloud Run functions, App Engine, Eventarc, Cloud Tasks, Scheduler and Workflows. What replaces what, what behaves differently, what changes on the bill, and a step-by-step plan.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5zWIxhPF5Atj1ecg.png" /></figure><p>“Serverless” means you give the cloud your code, and it runs it for you. You don’t pick servers. You don’t patch them. You don’t keep them running. The cloud starts your code when it is needed and stops it when it is not.</p><p>On Google Cloud (GCP), serverless usually means Cloud Run, Cloud Run functions and App Engine. It also means the services that connect them: Eventarc, Pub/Sub, Cloud Tasks, Cloud Scheduler and Workflows.</p><p>Teams move these apps to AWS for simple reasons. The rest of the company is on AWS. The data has already moved. Or the apps need to sit close to other AWS services.</p><p>Serverless looks like the easiest thing to move. There are no servers to copy. But each cloud has different default settings, and that is where the work is. Cloud Run sends many requests to one copy of your app. Lambda sends one request at a time. Cloud Run lets a request run for an hour. Lambda stops after 15 minutes. Small differences like these can break an app that worked fine on GCP.</p><blockquote><em>“Serverless is, instead, a mindset: make technology decisions that further your ability to focus on what differentiates you as a business.”</em></blockquote><blockquote><em>— </em><strong><em>Ben Kehoe</em></strong><em>, AWS Serverless Hero, in his talk </em><a href="https://www.meetup.com/serverless-boston/events/262376552/">Serverless as a mindset</a></blockquote><p>That is a good test for the move too. The goal is not to copy every GCP service one to one. The goal is to end up with less to look after. This guide covers:</p><ul><li>Which AWS service replaces each GCP serverless service</li><li>What works differently, and what tends to break</li><li>How events, queues and schedules move</li><li>What changes on the bill</li><li>A simple step-by-step plan</li></ul><h3>The Quick Map</h3><p>Here is each GCP serverless service and its closest match on AWS. The rest of the post explains each row.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AS7TDcef8aKouU8M.png" /></figure><ul><li><strong>Cloud Run services</strong> — Closest AWS match: Amazon ECS Express Mode, or AWS Lambda; Watch out for: Cloud Run shares one copy of the app between many requests; Lambda does not</li><li><strong>Cloud Run jobs</strong> — Closest AWS match: ECS tasks on Fargate, or AWS Batch; Watch out for: Task numbering and retries are set up differently</li><li><strong>Cloud Run functions</strong> — Closest AWS match: AWS Lambda; Watch out for: 15-minute limit and a new code entry point</li><li><strong>App Engine standard</strong> — Closest AWS match: Lambda, or Elastic Beanstalk; Watch out for: Old built-in services must be replaced</li><li><strong>App Engine flexible</strong> — Closest AWS match: Elastic Beanstalk, or ECS on Fargate; Watch out for: app.yaml settings move to new config</li><li><strong>API Gateway / Cloud Endpoints</strong> — Closest AWS match: Amazon API Gateway; Watch out for: Different login options and limits</li><li><strong>Eventarc</strong> — Closest AWS match: Amazon EventBridge; Watch out for: Events look different, so code that reads them changes</li><li><strong>Pub/Sub push</strong> — Closest AWS match: SNS and SQS, or EventBridge; Watch out for: Retries are set on the queue</li><li><strong>Cloud Tasks</strong> — Closest AWS match: Amazon SQS with Lambda; Watch out for: SQS holds tasks; something must read them</li><li><strong>Cloud Scheduler</strong> — Closest AWS match: EventBridge Scheduler; Watch out for: Each schedule names its own time zone and target</li><li><strong>Workflows</strong> — Closest AWS match: AWS Step Functions; Watch out for: Workflows are rewritten, not converted</li><li><strong>Secret Manager</strong> — Closest AWS match: AWS Secrets Manager, or Parameter Store; Watch out for: Access comes from the app’s IAM role</li></ul><blockquote><strong><em>What about App Runner?</em></strong><em> It looks like the obvious match for Cloud Run. But AWS </em><a href="https://docs.aws.amazon.com/apprunner/latest/dg/apprunner-availability-change.html"><em>closed App Runner to new customers on April 30, 2026</em></a><em>. For new apps, AWS points to ECS Express Mode instead.</em></blockquote><h3>Cloud Run: Containers or Functions</h3><p>Cloud Run runs your app in a container (a package with your code and everything it needs). It adds copies when traffic grows and removes them when traffic stops. On AWS you have two good choices:</p><ul><li><strong>ECS Express Mode</strong> is the closest match. You give it your container and two IAM roles. AWS <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/express-service-overview.html">sets up the rest</a>: the service on Fargate, a load balancer, scaling and networking. Your container does not change. Like Cloud Run, one copy of the app can serve many requests at once.</li><li><strong>AWS Lambda</strong> runs your code only when a request comes in. You pay per request. It is great for small APIs and for traffic that comes in bursts. But a normal Lambda copy handles <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html">one request at a time</a>. Lambda can also run <a href="https://docs.aws.amazon.com/lambda/latest/dg/images-create.html">container images</a>, but your code must use Lambda’s request format.</li></ul><p>Here are the main differences side by side. The Lambda numbers come from the <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html">Lambda quotas page</a>:</p><ul><li><strong>Requests per copy</strong> — Cloud Run: Up to 1,000 (80 is common); ECS Express Mode: As many as your app can take; Lambda: 1</li><li><strong>Longest request</strong> — Cloud Run: 60 minutes; ECS Express Mode: Set by the load balancer; Lambda: 15 minutes</li><li><strong>Scale to zero</strong> — Cloud Run: Yes; ECS Express Mode: No, at least one copy runs; Lambda: Yes</li><li><strong>Stay warm</strong> — Cloud Run: Minimum instances; ECS Express Mode: Minimum number of tasks; Lambda: Provisioned concurrency</li><li><strong>Largest request body</strong> — Cloud Run: 32 MiB; ECS Express Mode: Load balancer limits; Lambda: 6 MB</li><li><strong>What you deploy</strong> — Cloud Run: Container; ECS Express Mode: Container; Lambda: Zip file or container</li></ul><p>Two things follow from this. First, database connections. On Cloud Run, 100 requests might share two copies of the app and a few connections. On Lambda, 100 requests means 100 copies, and each opens its own connections. The database can run out. Use <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html">RDS Proxy</a> to share connections, or keep the app on ECS. Second, anything that runs for more than 15 minutes cannot go on Lambda as it is.</p><p>Then there are cold starts. A cold start is the short wait while Lambda starts a new copy of your code. Many teams worry about it too much:</p><blockquote><em>“Cold starts that don’t add to user-facing latency is generally not worth worrying about.”</em></blockquote><blockquote><em>— </em><strong><em>Yan Cui</em></strong><em>, AWS Serverless Hero, in </em><a href="https://www.slideshare.net/theburningmonk/running-serverless-at-scale">Running Serverless at Scale</a></blockquote><p>If users do feel it, turn on <a href="https://docs.aws.amazon.com/lambda/latest/dg/provisioned-concurrency.html">provisioned concurrency</a>, which keeps copies ready, or <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html">SnapStart</a> for Java, Python and .NET.</p><blockquote><strong><em>Rule of thumb:</em></strong><em> if the Cloud Run service is a full web app (a framework, a database, long requests), move the same container to ECS Express Mode. If it is a small API or webhook with spiky traffic, move it to Lambda.</em></blockquote><p>There is also a middle option. <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-managed-instances.html">Lambda Managed Instances</a> run Lambda on EC2 machines that AWS looks after, and one copy can handle many requests at once. It suits steady, busy traffic. Your code must be safe to run many requests in parallel.</p><h3>Cloud Run jobs</h3><p>Cloud Run jobs run a container until the work is done, often as many tasks at once. On AWS, run the same container as an <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html">ECS task on Fargate</a>. Start it from EventBridge Scheduler or Step Functions. For big jobs split into many parts, use <a href="https://docs.aws.amazon.com/batch/latest/userguide/what-is-batch.html">AWS Batch</a> array jobs. One small change: Cloud Run tells each task its number in CLOUD_RUN_TASK_INDEX. AWS Batch uses AWS_BATCH_JOB_ARRAY_INDEX.</p><h3>Functions: Cloud Run Functions to Lambda</h3><p>Cloud Run functions (once called Cloud Functions) map most directly to <a href="https://docs.aws.amazon.com/lambda/latest/dg/welcome.html">AWS Lambda</a>. The idea is the same: a small piece of code that runs when a request or an event arrives. What changes is the code around it:</p><ul><li><strong>Entry point</strong> — Cloud Run functions: Functions Framework (@functions_framework.http); Lambda: handler(event, context)</li><li><strong>Web address</strong> — Cloud Run functions: Built in; Lambda: Function URL or API Gateway</li><li><strong>Started by events</strong> — Cloud Run functions: Eventarc or Pub/Sub; Lambda: SQS, SNS, EventBridge and others</li><li><strong>Memory and CPU</strong> — Cloud Run functions: Set one by one; Lambda: Set memory; CPU grows with it</li><li><strong>Longest run</strong> — Cloud Run functions: 60 minutes for HTTP; Lambda: 15 minutes</li><li><strong>Local files</strong> — Cloud Run functions: Kept in memory; Lambda: /tmp, up to 10 GB</li></ul><p>Most of the work is in the entry point and the trigger, not in the business logic. Keep the logic in its own file. Then write a thin entry point for each cloud. That way you can test both with the same code.</p><h3>App Engine</h3><p>App Engine is GCP’s oldest serverless service. How you move it depends on which kind you use:</p><ul><li><strong>App Engine flexible</strong> already runs containers. Move it to ECS on Fargate. Or use <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html">Elastic Beanstalk</a> if the team likes the “push code, get an app” style.</li><li><strong>App Engine standard</strong> apps on newer runtimes are normal web apps. Put them in a container and treat them like Cloud Run.</li><li><strong>Older App Engine apps</strong> use built-in services like Memcache, Task Queues, Users and Datastore. Each needs a new home on AWS: ElastiCache, SQS, Amazon Cognito and DynamoDB. This is real code work, so find these apps early.</li></ul><p>App Engine also has small config files that are easy to forget. cron.yaml becomes EventBridge Scheduler schedules. dispatch.yaml becomes load balancer rules. queue.yaml becomes SQS queues.</p><h3>Events, Queues and Schedules</h3><p>Serverless apps talk to each other through events: “an order was placed”, “a file was uploaded”. This is where small differences cause the most bugs:</p><ul><li><strong>Eventarc to EventBridge.</strong> Eventarc sends events in the CloudEvents format. <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html">EventBridge</a> uses its own format, with fields like source, detail-type and detail. Every function that reads an event needs a small change.</li><li><strong>Pub/Sub push to SNS and SQS.</strong> Pub/Sub push calls your web address and tries again if it fails. On AWS, put an <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/welcome.html">SQS queue</a> in front of each reader. Lambda then <a href="https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html">reads the queue</a> in batches. Messages that keep failing go to a dead-letter queue (a side queue for messages that could not be handled).</li><li><strong>Cloud Tasks to SQS.</strong> Cloud Tasks calls a web address for each task, at a rate you set. SQS only holds the tasks. Something has to read them. Use Lambda with a <a href="https://docs.aws.amazon.com/lambda/latest/dg/services-sqs-scaling.html">maximum concurrency</a> setting to control the rate.</li><li><strong>Cloud Scheduler to EventBridge Scheduler.</strong> <a href="https://docs.aws.amazon.com/scheduler/latest/UserGuide/what-is-scheduler.html">EventBridge Scheduler</a> supports cron, time zones and one-time schedules. It can start Lambda, ECS tasks and Step Functions directly.</li><li><strong>Workflows to Step Functions.</strong> GCP Workflows are steps written in YAML. <a href="https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html">Step Functions</a> are steps written in JSON. The ideas are the same (steps, retries, choices, waits), but each workflow is rewritten by hand.</li></ul><blockquote><strong><em>Make every handler safe to run twice.</em></strong><em> On both clouds, a message can arrive more than once. On AWS, if one message in a batch fails, the whole batch is retried unless you </em><a href="https://docs.aws.amazon.com/lambda/latest/dg/services-sqs-errorhandling.html"><em>report which ones failed</em></a><em>. If a handler sends an email or charges a card, save an ID so it never does it twice.</em></blockquote><h3>APIs, Access and Identity</h3><p>Who can call what works on the same idea in both clouds. Only the names change:</p><ul><li><strong>Service account on a service</strong> — AWS: IAM role for the Lambda function or ECS task</li><li><strong>roles/run.invoker on a service</strong> — AWS: Lambda resource policy, or IAM login on a function URL</li><li><strong>Services calling each other with tokens</strong> — AWS: IAM-signed calls, or a private API in API Gateway</li><li><strong>“Allow unauthenticated”</strong> — AWS: A public function URL or public API</li><li><strong>Identity-Aware Proxy</strong> — AWS: Load balancer login with Amazon Cognito</li><li><strong>API keys in API Gateway</strong> — AWS: <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html">Usage plans and API keys</a> in Amazon API Gateway</li></ul><p>Give each function or service its own IAM role, with only the access it needs. Don’t make one big role for everything, even if the old apps shared one service account.</p><h3>Networking You’ll Trip Over</h3><ul><li><strong>Reaching private databases.</strong> Cloud Run reaches your private network through a connector or Direct VPC egress. Lambda can <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html">join your VPC</a> (your private network on AWS). ECS tasks run inside it already.</li><li><strong>Reaching the internet from the VPC.</strong> A Lambda function inside a VPC cannot reach the internet on its own. It needs a NAT gateway, which costs money per hour and per GB. For AWS services like S3 and DynamoDB, use VPC endpoints instead. They are cheaper.</li><li><strong>Custom domains.</strong> A Cloud Run domain mapping becomes a certificate in ACM, plus a load balancer, CloudFront or an API Gateway custom domain.</li><li><strong>Calls back to GCP.</strong> During the move, some apps still call GCP. That is slower and costs money for data leaving GCP. Remove these calls first.</li></ul><h3>A Simple Way to Decide</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rXhB-crYjAbPJUuh.png" /></figure><ol><li><strong>Does it run for more than 15 minutes?</strong> Use ECS on Fargate or AWS Batch.</li><li><strong>Is it a full web app</strong> with a framework, a database or steady traffic? Use ECS Express Mode with the same container.</li><li><strong>Is it a small API, webhook or event handler?</strong> Use Lambda.</li><li><strong>Does it run on a schedule?</strong> Use EventBridge Scheduler to start a Lambda function or an ECS task.</li><li><strong>Does it run several steps in a row, with retries and waits?</strong> Use Step Functions.</li></ol><h3>What Changes on the Bill</h3><p>Both clouds charge for the time your code runs and for each request. The details change the total:</p><ul><li><strong>Pay per request</strong> — GCP: Cloud Run: CPU time, memory time, requests; AWS: <a href="https://aws.amazon.com/lambda/pricing/">Lambda</a>: memory time and requests</li><li><strong>Always-on containers</strong> — GCP: Cloud Run instance billing; AWS: <a href="https://aws.amazon.com/fargate/pricing/">Fargate</a>: CPU and memory per second, plus the load balancer</li><li><strong>Staying warm</strong> — GCP: Minimum instances (lower idle price); AWS: Provisioned concurrency (paid while it is on)</li><li><strong>APIs</strong> — GCP: API Gateway per call; AWS: API Gateway per call; HTTP APIs cost less than REST APIs</li><li><strong>Events and queues</strong> — GCP: Eventarc, Pub/Sub, Cloud Tasks; AWS: EventBridge, SNS, SQS, all per request</li><li><strong>Discounts</strong> — GCP: Committed use discounts; AWS: <a href="https://aws.amazon.com/savingsplans/compute-pricing/">Compute Savings Plans</a> (cover Lambda and Fargate)</li></ul><p>Three things catch teams out:</p><ul><li><strong>The load balancer.</strong> ECS Express Mode puts a load balancer in front of your app. It costs money even with no traffic. Several apps can share one.</li><li><strong>NAT gateways.</strong> Lambda functions in a VPC that call the internet go through NAT. A lot of outgoing traffic becomes a surprise on the bill.</li><li><strong>Waiting time.</strong> On Lambda you pay while your code waits for other services. An app that spends most of its time waiting may be cheaper on Fargate.</li></ul><p>Run the new setup for a few weeks before you buy a Savings Plan. Real usage is the only good basis for a commitment.</p><h3>What It Looks Like in Code</h3><p>A simple HTTP function on GCP and the same function on Lambda:</p><pre># GCP: Cloud Run function (Python)<br>import functions_framework<br> <br>@functions_framework.http<br>def hello(request):<br>    name = request.args.get(&quot;name&quot;, &quot;world&quot;)<br>    return {&quot;message&quot;: f&quot;Hello, {name}&quot;}<br> <br># AWS: Lambda behind a function URL or HTTP API (Python)<br>import json<br> <br>def handler(event, context):<br>    params = event.get(&quot;queryStringParameters&quot;) or {}<br>    name = params.get(&quot;name&quot;, &quot;world&quot;)<br>    return {<br>        &quot;statusCode&quot;: 200,<br>        &quot;headers&quot;: {&quot;Content-Type&quot;: &quot;application/json&quot;},<br>        &quot;body&quot;: json.dumps({&quot;message&quot;: f&quot;Hello, {name}&quot;}),<br>    }</pre><p>A function that reads Pub/Sub messages, and the same function reading from SQS:</p><pre># GCP: triggered by a Pub/Sub topic through Eventarc<br>import base64, json<br>import functions_framework<br> <br>@functions_framework.cloud_event<br>def on_order(cloud_event):<br>    data = base64.b64decode(cloud_event.data[&quot;message&quot;][&quot;data&quot;])<br>    process(json.loads(data))<br> <br># AWS: triggered by an SQS queue, with partial batch failures<br>import json<br> <br>def handler(event, context):<br>    failed = []<br>    for record in event[&quot;Records&quot;]:<br>        try:<br>            process(json.loads(record[&quot;body&quot;]))<br>        except Exception:<br>            failed.append({&quot;itemIdentifier&quot;: record[&quot;messageId&quot;]})<br>    return {&quot;batchItemFailures&quot;: failed}</pre><p>And a Cloud Run service in Terraform, next to the same Lambda function:</p><pre># GCP: a Cloud Run service<br>resource &quot;google_cloud_run_v2_service&quot; &quot;api&quot; {<br>  name     = &quot;api&quot;<br>  location = &quot;us-central1&quot;<br>  template {<br>    containers {<br>      image = &quot;us-docker.pkg.dev/shop-prod/apps/api:1.4.2&quot;<br>      resources { limits = { cpu = &quot;1&quot;, memory = &quot;512Mi&quot; } }<br>    }<br>    scaling { min_instance_count = 1 }<br>    max_instance_request_concurrency = 80<br>    service_account = google_service_account.api.email<br>  }<br>}<br> <br># AWS: the same API as a Lambda function from a container image<br>resource &quot;aws_lambda_function&quot; &quot;api&quot; {<br>  function_name = &quot;api&quot;<br>  package_type  = &quot;Image&quot;<br>  image_uri     = &quot;123456789012.dkr.ecr.us-east-1.amazonaws.com/api:1.4.2&quot;<br>  memory_size   = 1024                    # CPU grows with memory<br>  timeout       = 30<br>  role          = aws_iam_role.api.arn    # was the service account<br>}<br> <br>resource &quot;aws_lambda_function_url&quot; &quot;api&quot; {<br>  function_name      = aws_lambda_function.api.function_name<br>  authorization_type = &quot;AWS_IAM&quot;         # was roles/run.invoker<br>}</pre><p>These snippets show the shape, not every setting. Check the current docs before you copy them.</p><h3>Things That Bite Later</h3><blockquote><em>“Failures are a given and everything will eventually fail over time.”</em></blockquote><blockquote><em>— </em><strong><em>Werner Vogels</em></strong><em>, CTO of Amazon, in </em><a href="https://www.allthingsdistributed.com/2016/03/10-lessons-from-10-years-of-aws.html">10 Lessons from 10 Years of AWS</a></blockquote><p>These are the small things that tend to break after the move:</p><ul><li><strong>Timeouts in a chain.</strong> API Gateway REST APIs stop waiting after <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-execution-service-limits-table.html">29 seconds by default</a>. A Lambda behind it can run longer, but the caller has already given up. Check every timeout from the user to the database.</li><li><strong>Large uploads.</strong> Lambda takes up to 6 MB per normal request. Big file uploads that worked on Cloud Run should go straight to S3 with a <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html">pre-signed URL</a>.</li><li><strong>Things kept in memory.</strong> Code that keeps a cache or a counter in memory acts differently when every request has its own copy of the app.</li><li><strong>Logs and alerts.</strong> Cloud Logging searches and alerts become <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html">CloudWatch Logs Insights</a> queries and CloudWatch alarms. Rebuild the alerts people rely on before you move traffic.</li><li><strong>Secrets.</strong> Secret Manager paths like projects/.../secrets/... become <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html">Secrets Manager</a> or Parameter Store names. Search your code for all of them.</li><li><strong>Limits.</strong> New AWS accounts start with a low Lambda concurrency limit. Ask for more weeks before you move real traffic.</li></ul><h3>Doing the Move, Step by Step</h3><ol><li><strong>List everything.</strong> Every Cloud Run service and job, function, App Engine app, trigger, queue, schedule and workflow, with its traffic, run time, cost and owner.</li><li><strong>Pick the AWS service</strong> for each one, using the questions above. Write down why.</li><li><strong>Build the base:</strong> AWS accounts, networks, a container registry (ECR), IAM roles, logs, alarms and higher limits. The <a href="https://docs.aws.amazon.com/wellarchitected/latest/serverless-applications-lens/welcome.html">Serverless Applications Lens</a> is a good checklist.</li><li><strong>Start with one small app.</strong> Move it end to end: code, triggers, secrets, alarms and domain.</li><li><strong>Run both clouds side by side.</strong> Send a small share of users to AWS using <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy-weighted.html">weighted DNS in Route 53</a>. Compare errors and speed.</li><li><strong>Move the events.</strong> Point schedules and queues at AWS one at a time. Empty the GCP queues before you turn them off.</li><li><strong>Clean up.</strong> Turn off the GCP services, delete old service accounts and keys, and buy Savings Plans once usage is steady.</li></ol><blockquote><em>“Serverless is still the future because the mindset shift is the thing we haven’t gotten to.”</em></blockquote><blockquote><em>— </em><strong><em>Ben Kehoe</em></strong><em>, AWS Serverless Hero, speaking to </em><a href="https://sdtimes.com/cloud/sd-times-blog-getting-a-serverless-reality-check/">SD Times</a></blockquote><p>Serverless is often the fastest part of a cloud move, because there are no servers to copy. The work is in the default settings: how many requests one copy takes, how long a request may run, and how events are retried. Get those right, and the rest is mostly config.</p><h3>Common Questions</h3><h3>What is the Cloud Run equivalent in AWS?</h3><p>ECS Express Mode is the closest: same container, one copy serving many requests, with AWS setting up Fargate, the load balancer and scaling. AWS Lambda fits small APIs and bursty traffic. App Runner is another option for simple web apps.</p><h3>Cloud Run vs Lambda: which should I pick?</h3><p>Pick Lambda for small APIs, webhooks and event handlers that can scale to zero. Pick ECS for full web apps, steady traffic, requests longer than 15 minutes, or bodies over 6 MB. Watch database connections: on Lambda every request is its own copy, so use RDS Proxy.</p><h3>Cloud Run vs Fargate: what changes?</h3><p>ECS on Fargate runs the same container, but it does not scale to zero, so at least one task runs all the time and a load balancer sits in front of it. In return you get long requests and many requests per copy, like Cloud Run.</p><h3>How do I migrate Cloud Functions to Lambda?</h3><p>The business logic usually stays. What changes is the entry point (Functions Framework becomes handler(event, context)), the trigger (Eventarc or Pub/Sub becomes SQS, SNS or EventBridge), and the 15-minute run limit. Keep the logic in its own file and write a thin entry point for each cloud.</p><h3>Eventarc vs EventBridge: what is different?</h3><p>Eventarc sends CloudEvents. EventBridge uses its own shape with source, detail-type and detail. Every function that reads an event needs a small change.</p><h3>What is the Cloud Tasks equivalent in AWS?</h3><p>Amazon SQS with Lambda. SQS holds the tasks but does not call anything, so Lambda reads the queue, and the maximum concurrency setting controls the rate. Failed tasks go to a dead-letter queue.</p><h3>What is the App Engine equivalent in AWS?</h3><p>App Engine flexible moves to ECS on Fargate or Elastic Beanstalk. Standard apps on newer runtimes go in a container. Older apps that use Memcache, Task Queues, Users or Datastore need ElastiCache, SQS, Cognito and DynamoDB. cron.yaml becomes EventBridge Scheduler.</p><h3>About MigrateX</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/0*nYb8n5zSUa9hqVo3.png" /></figure><p>MigrateX is our platform and service for moving software, data and infrastructure from one technology to another. It combines automation with experienced engineers. The automation does the repetitive work quickly, and the engineers make the tricky decisions.</p><p>Here’s how we run a GCP to AWS serverless move with MigrateX:</p><ol><li><strong>Assessment.</strong> We list every Cloud Run service, function, App Engine app, trigger, queue, schedule and workflow, with its traffic, run time, cost and owner. You see where the work is before anyone agrees on a timeline.</li><li><strong>Plan.</strong> We work with your team to pick the AWS target for each service, design the IAM roles and networking, and decide the order of the move.</li><li><strong>Migration, step by step.</strong> Automation does the repetitive parts: rewriting handlers and event formats, turning Cloud Run and App Engine config into ECS, Lambda and EventBridge, and converting Terraform. Our engineers handle the parts that need thought: long-running work, concurrency, App Engine bundled services and Workflows.</li><li><strong>Proof that it works.</strong> Both clouds run side by side. We shift traffic a little at a time and compare errors, response times and costs before each step.</li><li><strong>Handover and clean-up.</strong> We turn off GCP services one at a time, set up Savings Plans once usage is steady, and leave your team with a setup they understand and own.</li></ol><p><strong>What you get along the way:</strong></p><ul><li><strong>No big-bang switch.</strong> Traffic moves a little at a time, with a quick way back.</li><li><strong>No lost events.</strong> Queues and schedules move one at a time and are drained before anything is turned off.</li><li><strong>A smaller bill, not a bigger one.</strong> Right-sized functions, shared load balancers and Savings Plans are part of the move, not an afterthought.</li><li><strong>One partner for the whole move.</strong> The same team and approach covers your serverless apps, your compute and your data.</li></ul><blockquote><em>Planning a move from GCP to AWS? We’d love to hear about it. Tell us a little about your setup through </em><a href="https://cobuildx.ai/contact"><em>Contact Us</em></a><em>, and we’ll start with a free chat about where the work is likely to be.</em></blockquote><h3>AWS</h3><ul><li>AWS. <em>AWS App Runner availability change</em>. <a href="https://docs.aws.amazon.com/apprunner/latest/dg/apprunner-availability-change.html">https://docs.aws.amazon.com/apprunner/latest/dg/apprunner-availability-change.html</a></li><li>AWS. <em>Amazon ECS Express Mode</em>. <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/express-service-overview.html">https://docs.aws.amazon.com/AmazonECS/latest/developerguide/express-service-overview.html</a></li><li>AWS. <em>AWS Fargate for Amazon ECS</em>. <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html">https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html</a></li><li>AWS. <em>Understanding Lambda function scaling</em>. <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html">https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html</a></li><li>AWS. <em>Lambda Managed Instances</em>. <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-managed-instances.html">https://docs.aws.amazon.com/lambda/latest/dg/lambda-managed-instances.html</a></li><li>AWS. <em>Create a Lambda function using a container image</em>. <a href="https://docs.aws.amazon.com/lambda/latest/dg/images-create.html">https://docs.aws.amazon.com/lambda/latest/dg/images-create.html</a></li><li>AWS. <em>Lambda SnapStart</em>. <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html">https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html</a></li><li>AWS. <em>Using Lambda with Amazon SQS</em>. <a href="https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html">https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html</a></li><li>AWS. <em>Handling errors for an SQS event source in Lambda</em>. <a href="https://docs.aws.amazon.com/lambda/latest/dg/services-sqs-errorhandling.html">https://docs.aws.amazon.com/lambda/latest/dg/services-sqs-errorhandling.html</a></li><li>AWS. <em>Giving Lambda functions access to resources in a VPC</em>. <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html">https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html</a></li><li>AWS. <em>Amazon EventBridge</em>. <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html">https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html</a></li><li>AWS. <em>Amazon EventBridge Scheduler</em>. <a href="https://docs.aws.amazon.com/scheduler/latest/UserGuide/what-is-scheduler.html">https://docs.aws.amazon.com/scheduler/latest/UserGuide/what-is-scheduler.html</a></li><li>AWS. <em>AWS Step Functions</em>. <a href="https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html">https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html</a></li><li>AWS. <em>AWS Batch</em>. <a href="https://docs.aws.amazon.com/batch/latest/userguide/what-is-batch.html">https://docs.aws.amazon.com/batch/latest/userguide/what-is-batch.html</a></li><li>AWS. <em>Amazon RDS Proxy</em>. <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html">https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html</a></li><li>AWS. <em>Lambda quotas</em>. <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html">https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html</a></li><li>AWS. <em>Provisioned concurrency for Lambda</em>. <a href="https://docs.aws.amazon.com/lambda/latest/dg/provisioned-concurrency.html">https://docs.aws.amazon.com/lambda/latest/dg/provisioned-concurrency.html</a></li><li>AWS. <em>Quotas for REST APIs in API Gateway</em>. <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-execution-service-limits-table.html">https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-execution-service-limits-table.html</a></li><li>AWS. <em>Serverless Applications Lens, AWS Well-Architected</em>. <a href="https://docs.aws.amazon.com/wellarchitected/latest/serverless-applications-lens/welcome.html">https://docs.aws.amazon.com/wellarchitected/latest/serverless-applications-lens/welcome.html</a></li><li>AWS. <em>Weighted routing in Route 53</em>. <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy-weighted.html">https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy-weighted.html</a></li><li>AWS. <em>AWS Elastic Beanstalk</em>. <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html">https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html</a></li></ul><h3>Expert sources</h3><ul><li>Ben Kehoe. <em>Serverless as a mindset</em>. Serverless Boston meetup talk. <a href="https://www.meetup.com/serverless-boston/events/262376552/">https://www.meetup.com/serverless-boston/events/262376552/</a></li><li>Ben Kehoe, quoted in <em>Getting a serverless reality check</em>. SD Times. <a href="https://sdtimes.com/cloud/sd-times-blog-getting-a-serverless-reality-check/">https://sdtimes.com/cloud/sd-times-blog-getting-a-serverless-reality-check/</a></li><li>Yan Cui. <em>Running Serverless at Scale</em>. <a href="https://www.slideshare.net/theburningmonk/running-serverless-at-scale">https://www.slideshare.net/theburningmonk/running-serverless-at-scale</a></li><li>Werner Vogels. <em>10 Lessons from 10 Years of Amazon Web Services</em>. All Things Distributed, 2016. <a href="https://www.allthingsdistributed.com/2016/03/10-lessons-from-10-years-of-aws.html">https://www.allthingsdistributed.com/2016/03/10-lessons-from-10-years-of-aws.html</a></li></ul><h3>Google Cloud</h3><ul><li>Google Cloud. <em>Cloud Run quotas and limits</em>. <a href="https://cloud.google.com/run/quotas">https://cloud.google.com/run/quotas</a></li><li>Google Cloud. <em>Maximum concurrent requests for services</em>. <a href="https://cloud.google.com/run/docs/about-concurrency">https://cloud.google.com/run/docs/about-concurrency</a></li><li>Google Cloud. <em>Cloud Run functions overview</em>. <a href="https://cloud.google.com/functions/docs/concepts/overview">https://cloud.google.com/functions/docs/concepts/overview</a></li></ul><p><em>Originally published at </em><a href="https://cobuildx.ai/blog/gcp-to-aws-serverless"><em>cobuildx.ai/blog/gcp-to-aws-serverless</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c246373a19c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A 14-Year-Old PHP Bug Lets Strangers Run Code on Your Server. Here's How to Stop It]]></title>
            <link>https://medium.com/@cobuildx.ai/a-14-year-old-php-bug-lets-strangers-run-code-on-your-server-heres-how-to-stop-it-880e9bd9832c?source=rss-f6d64156316d------2</link>
            <guid isPermaLink="false">https://medium.com/p/880e9bd9832c</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[CobuildX AI]]></dc:creator>
            <pubDate>Thu, 22 Oct 2026 12:02:20 GMT</pubDate>
            <atom:updated>2026-10-22T12:02:20.186Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7TjQ_zAL_oH6LsKTAx226g.png" /></figure><p><em>The code nobody touched for years just became everyone’s problem. A bug hiding in PHP since 2012 lets strangers run code on web servers, and the NSA and India’s CERT-In have both raised the alarm. Here’s how PHP2Shell (CVE-2026–109618 and CVE-2026–109619) works, how it was found, and exactly what to do about it.</em></p><p>On 21 October 2026, PHP shipped an emergency release for two critical bugs in the PHP engine itself: CVE-2026–109618 and CVE-2026–109619, nicknamed <strong>PHP2Shell</strong>. Both let an attacker run code on a web server without logging in [1][2].</p><p>Governments moved fast. The NSA told organizations that can’t update right away to take their PHP systems offline [3]. The same day, India’s national cybersecurity agency, <strong>CERT-In</strong>, issued a critical-severity advisory (CIVN-2026–0510) warning that vulnerable PHP servers could be exposed to remote code execution [10][11]. CISA in the US issued its own alert [6].</p><p>The unsettling part is where the bugs came from: code that has sat in PHP since 2012, and that attackers started probing before a patch existed. This post explains what the two bugs are, how they work, how they were found, and what to do about them. If you run PHP anywhere, including inside WordPress, Drupal, Magento or an internal tool, it applies to you.</p><h3>The Two Bugs at a Glance</h3><ul><li><strong>Name in the advisory</strong>: CVE-2026–109618 — RCE via OOM corruption; CVE-2026–109619 — RCE via stale global state</li><li><strong>Bug type</strong>: CVE-2026–109618 — Memory corruption when PHP runs out of memory; CVE-2026–109619 — Use-after-free across two requests</li><li><strong>Severity</strong>: CVE-2026–109618 — CVSS v4.0 9.2, critical; CVE-2026–109619 — CVSS v4.0 9.2, critical</li><li><strong>Login needed?</strong>: CVE-2026–109618 — No; CVE-2026–109619 — No</li><li><strong>Confirmed exploit</strong>: CVE-2026–109618 — Apache mod_php; CVE-2026–109619 — mod_php and PHP-FPM</li><li><strong>Advisory</strong>: CVE-2026–109618 — GHSA-w8hw-w9fx-j79w; CVE-2026–109619 — GHSA-6wmf-4rv5-p3rp</li></ul><p>In both cases, a successful attack runs code as the web server’s PHP user. From there an attacker can read files, steal database passwords and keys from config files, or plant a backdoor [1][2].</p><h3>How the Bugs Work</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CyjFc6hhHZJqRR1Kf9MSQg.png" /></figure><h3>CVE-2026–109618: running out of memory at the wrong moment</h3><p>When PHP runs out of memory, it doesn’t return an error step by step. It jumps straight out of whatever it was doing, using a C function called longjmp(). If that happens while a request is still being set up, some of the request&#39;s data is left half-built. Later, when PHP cleans up the request, it treats that half-built data as valid, and memory gets corrupted [1].</p><p>An attacker can cause this on purpose. Weaknesses in how PHP parses multipart form uploads let a crafted request use up memory while still looking like it’s within the configured limits. On Apache with mod_php, this happens before any application code runs, so the app itself doesn’t need to have a bug [1][4].</p><h3>CVE-2026–109619: one request’s leftovers, used by the next</h3><p>A PHP worker handles many requests in a row, and it keeps some global state between them: error, session and extension data. Normally that state is reset at the end of each request. But a fatal error, such as running out of memory or hitting the execution time limit, can skip that reset. The worker is left holding a pointer to memory that’s already been freed [2].</p><p>If the next request on the same worker touches that state before it’s reset, PHP uses freed memory. The advisory confirms two ways to reach it. One is <strong>session upload progress</strong>, a feature that’s on by default and works even if the app never calls session_start(). The other is PHP 8.5&#39;s new <strong>fatal error backtraces</strong> setting, also on by default. Besides running code, this bug can leak memory from other users&#39; requests, including passwords and tokens [2].</p><h3>How It Was Found</h3><p>Both bugs were found in August 2026 by researchers auditing PHP’s C source with the help of AI models. Researcher Ryan Austin at Calif found one during an audit run under OpenAI’s “Patch the Planet” project. Wiz found the same flaws independently, using AI models alongside its own tooling [5]. The PHP advisories credit reporters from both efforts and others [1][2].</p><p>The weakness wasn’t entirely new. In 2024 a PHP core developer spotted the out-of-memory problem behind CVE-2026–109618 during an audit, but the team couldn’t agree on a fix, and a working exploit was thought unlikely, so it wasn’t prioritised [5]. The affected code dates back to PHP 5.4, released in 2012.</p><h3>Timeline</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yd15AkDGgZytxa7lXVc4MA.png" /></figure><p>The release was meant to be a normal coordinated disclosure, but it didn’t stay quiet. Amazon’s honeypots logged an exploit attempt on 17 October, four days early. On 20 October news leaked on Hacker News, watchTowr posted about it, and a proof-of-concept video was published by mistake, so PHP announced the release a day ahead. The fixes and the two GitHub advisories went out on 21 October, the same day as alerts from CISA, the NSA, India’s CERT-In and others [5][6][10].</p><p>Some organizations didn’t wait. Government portals in the Netherlands, Finland and France, many Wikimedia services and the Internet Archive went offline for a time as a precaution. Wiz compared the bug to Heartbleed, the 2014 OpenSSL flaw [5].</p><h3>Am I Affected?</h3><ul><li><strong>Versions:</strong> everything from PHP 5.4 up to, but not including, <strong>8.2.35, 8.3.36, 8.4.27 and 8.5.12</strong> [1][2].</li><li><strong>Server setups:</strong> any PHP that serves web requests: Apache mod_php (highest risk), PHP-FPM, php-cgi, FrankenPHP and LiteSpeed [4].</li><li><strong>Old versions:</strong> PHP 8.1 and older are end of life. The PHP team released source patches for 7.4, 8.0 and 8.1, but no official builds. Older versions get nothing [5].</li><li><strong>Hidden PHP:</strong> PHP is often bundled inside other products, such as control panels, appliances and vendor software. Cisco, for example, published its own advisory for affected products [6][7].</li></ul><p>To check a server, look at the version and the two settings that matter most:</p><pre>php -v<br>php -i | grep -E &#39;session.upload_progress.enabled|fatal_error_backtraces|memory_limit&#39;</pre><p>Run this with the same PHP the web server uses. The command-line PHP can be a different version from PHP-FPM or mod_php, so also check your web server’s phpinfo() page or package list.</p><h3>What to Do Now</h3><p>For security teams, this goes beyond applying an update. The work falls into four steps: patch, mitigate, contain and investigate. Start by finding every PHP install, internet-facing ones first [6].</p><h3>1. Patch</h3><p>Upgrade to a fixed release: <strong>8.5.12, 8.4.27, 8.3.36 or 8.2.35</strong>, or your Linux distribution’s patched package. Then <strong>restart every PHP worker</strong>: PHP-FPM, Apache and any long-running PHP processes. Until they restart, the old code is still running [1][2].</p><h3>2. Mitigate, if you can’t patch today</h3><p>The PHP advisories list temporary settings. Set them in php.ini, the PHP-FPM pool or the web server config. Setting them with ini_set() or .user.ini is too late to help [1][2][4].</p><pre>; CVE-2026-109619: closes the confirmed session path.<br>; Worth keeping off after patching if you don&#39;t use upload progress bars.<br>session.upload_progress.enabled = 0</pre><pre>; CVE-2026-109619, PHP 8.5 only: closes the confirmed backtrace path.<br>fatal_error_backtraces = 0</pre><pre>; CVE-2026-109618: avoids the out-of-memory jump. Not a complete fix,<br>; so pair it with tight request limits below and at your proxy.<br>memory_limit = -1<br>post_max_size = 8M<br>upload_max_filesize = 2M</pre><ul><li><strong>Limit requests before they reach PHP.</strong> At nginx, Apache or your load balancer, cap request size, the number of form fields and multipart parts, and headers per part. If your app doesn’t take file uploads or multipart forms, block them entirely [1].</li><li><strong>Put a web application firewall in front</strong> if you have one [6].</li><li><strong>Don’t rely on </strong><strong>RLIMIT_AS or </strong><strong>RLIMIT_DATA.</strong> These operating system memory limits can trigger the very bug you&#39;re trying to avoid [1].</li><li><strong>Hiding errors doesn’t help.</strong> Turning off display_errors or using @ doesn&#39;t stop the stale state from being used [4].</li></ul><blockquote><strong><em>These settings only close the paths researchers have confirmed so far.</em></strong><em> Both advisories say updating is the only complete fix [1][2].</em></blockquote><h3>3. Contain</h3><p>If an internet-facing system can’t be patched yet, or runs PHP 8.1 or older, take it offline until it’s patched or upgraded. This is what the NSA and CISA both advise [3][6]. Several governments, Wikimedia and the Internet Archive did exactly this on 21 October [5].</p><h3>4. Investigate</h3><p>Exploit attempts started before the patch, so a patched server may already have been hit. Look for:</p><ul><li>PHP worker processes starting a shell (sh, bash) or tools like curl and wget [6].</li><li>Signs of persistence: new or changed .php files in web directories (especially upload folders), new cron jobs or new user accounts.</li><li>Unexpected outbound connections from web servers.</li><li>Bursts of large or unusual multipart POST requests in your access logs.</li></ul><p>Clean logs don’t prove a server is safe [2]. If you find signs of compromise, treat it as an incident: rotate the database passwords and API keys stored on that server, not just the PHP version.</p><h3>The Bigger Lesson</h3><p><strong>Legacy code isn’t harmless just because it’s familiar.</strong> The code behind PHP2Shell had run on millions of servers for 14 years, and it was trusted because nothing had gone wrong yet.</p><p>Neither bug was in anyone’s PHP code. Both were memory-safety bugs in the PHP engine, which is written in C: memory used after it was freed, and data used before it was fully set up. These are the same classes of bug the NSA and CISA have pointed to for years when they urge a move to memory-safe languages for new code [8][9].</p><p>Two other points stand out. AI-assisted audits found bugs that had sat in widely used code for over a decade, and attackers have the same tools. And PHP runs a large share of the web, yet the PHP Foundation has only 13 employees and relies on donations [5]. If your business depends on PHP, supporting the foundation is part of keeping it safe.</p><p>For now, the steps are simple: find every PHP server, update it, restart it, and check it wasn’t hit first.</p><h3>References</h3><p><strong>Advisories</strong></p><ul><li>PHP. <em>RCE via OOM corruption</em> (CVE-2026–109618, GHSA-w8hw-w9fx-j79w). <a href="https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w">https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w</a></li><li>PHP. <em>RCE via stale global state</em> (CVE-2026–109619, GHSA-6wmf-4rv5-p3rp). <a href="https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp">https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp</a></li><li>NSA Cybersecurity. Post on PHP vulnerabilities, 21 October 2026. <a href="https://x.com/NSACyber/status/2112903220209098897">https://x.com/NSACyber/status/2112903220209098897</a></li></ul><p><strong>Analysis and background</strong></p><ul><li>Rapid7. <em>CVE-2026–109618 and CVE-2026–109619: Critical Unauthenticated Remote Code Execution in PHP.</em> <a href="https://www.rapid7.com/blog/post/etr-cve-2026-109618-and-cve-2026-109619-critical-unauthenticated-remote-code-execution-in-php/">https://www.rapid7.com/blog/post/etr-cve-2026-109618-and-cve-2026-109619-critical-unauthenticated-remote-code-execution-in-php/</a></li><li>Wikipedia. <em>PHP2Shell.</em> <a href="https://en.wikipedia.org/wiki/PHP2Shell">https://en.wikipedia.org/wiki/PHP2Shell</a></li><li>CISA. <em>Critical Vulnerabilities in PHP Require Immediate Patching</em>, 21 October 2026. <a href="https://www.cisa.gov/news-events/alerts/2026/10/21/critical-vulnerabilities-php-require-immediate-patching">https://www.cisa.gov/news-events/alerts/2026/10/21/critical-vulnerabilities-php-require-immediate-patching</a></li><li>Cisco. <em>Vulnerabilities in PHP Affecting Cisco Products: October 2026.</em> <a href="https://sec.cloudapps.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-php-october26-Jj384Daq">https://sec.cloudapps.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-php-october26-Jj384Daq</a></li><li>NSA. <em>Software Memory Safety</em> (Cybersecurity Information Sheet). <a href="https://media.defense.gov/2022/Nov/10/2003112742/-1/-1/0/CSI_SOFTWARE_MEMORY_SAFETY.PDF">https://media.defense.gov/2022/Nov/10/2003112742/-1/-1/0/CSI_SOFTWARE_MEMORY_SAFETY.PDF</a></li><li>CISA. <em>The Case for Memory Safe Roadmaps.</em> <a href="https://www.cisa.gov/resources-tools/resources/case-memory-safe-roadmaps">https://www.cisa.gov/resources-tools/resources/case-memory-safe-roadmaps</a></li><li>CERT-In. <em>Vulnerability Note CIVN-2026–0510: PHP2Shell vulnerabilities in PHP</em>, 21 October 2026. <a href="https://www.cert-in.org.in/s2cMainServlet?VLCODE=CIVN-2026-0510&amp;pageid=PUBVLNOTES01">https://www.cert-in.org.in/s2cMainServlet?VLCODE=CIVN-2026-0510&amp;pageid=PUBVLNOTES01</a></li><li>NewsBytes. <em>US NSA and India’s CERT-In flag ‘PHP2Shell’ web risk.</em> <a href="https://www.newsbytesapp.com/news/science/us-nsa-and-indias-cert-in-flag-php2shell-web-risk/tldr">https://www.newsbytesapp.com/news/science/us-nsa-and-indias-cert-in-flag-php2shell-web-risk/tldr</a></li></ul><p><em>CobuildX helps teams modernise legacy systems with </em><a href="https://cobuildx.ai/migratex"><em>MigrateX</em></a><em>.</em></p><p><em>Originally published on the </em><a href="https://cobuildx.ai/blog/php2shell-cve-2026-109618-109619"><em>CobuildX blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=880e9bd9832c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Modernizing Legacy Apps with RxJS: Streams as the Bridge Between Old and New]]></title>
            <link>https://medium.com/@cobuildx.ai/modernizing-legacy-apps-with-rxjs-streams-as-the-bridge-between-old-and-new-7741453d4b9d?source=rss-f6d64156316d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7741453d4b9d</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[rxjs]]></category>
            <dc:creator><![CDATA[CobuildX AI]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 06:18:02 GMT</pubDate>
            <atom:updated>2026-10-12T06:18:02.703Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ks6VtYwWE3-Z1ef9Uf6yog.png" /></figure><p><em>In most legacy migrations, the difficult part is the async code, not the templates: callbacks, observers, global events and timers that every screen depends on. This post explains how we use RxJS as a bridge, so the old UI and the new React UI share the same streams while screens are moved one by one.</em></p><p>In most legacy frontend migrations, the templates are not the hard part. Templates can be ported quite easily. The hard part is the <strong>async code</strong>. A jQuery handler sends a request, sets a global flag and fires a custom event. A Backbone model has three views listening to its change event. An Ember observer saves data on every keystroke. A setInterval keeps polling the server, and nobody in the team knows why it was added.</p><p>This is where the actual behavior of a legacy app lives, and it is spread across every page. We cannot move it one route at a time, because both the old screens and the new screens depend on it.</p><p>In such projects, we use <strong>RxJS</strong> as a <strong>bridge</strong> between the old app and the new one. We do not use it as the final architecture, and we do not use it just because Angular uses it. The approach is simple. Wrap each legacy event source in an Observable and keep the shared state behind a stream. Now the old UI and the new React UI can subscribe to the same data while screens are moved one by one. As a bonus, a lot of hand-written debounce, retry and cancel logic becomes a few lines of operators. This is the <a href="https://cobuildx.ai/blog/frontend-migration-strategies">branch by abstraction</a> pattern, with streams as the interface.</p><h3>The Short Version</h3><ul><li><strong>Callbacks and </strong><strong>$.Deferred chains</strong>: What goes wrong: Deeply nested, cannot be cancelled, errors get lost; RxJS replacement: from(promise), defer, switchMap</li><li><strong>Global or custom events (</strong><strong>$(document).trigger, Backbone </strong><strong>on)</strong>: What goes wrong: Any code can fire them, and nobody removes the listeners; RxJS replacement: fromEvent, fromEventPattern, typed Subjects</li><li><strong>Observers and watchers (Ember </strong><strong>observer, </strong><strong>$scope.$watch)</strong>: What goes wrong: Order is not clear, and they run too often; RxJS replacement: BehaviorSubject + distinctUntilChanged</li><li><strong>Hand-rolled debounce and timers</strong>: What goes wrong: Old responses overwrite new ones, timers keep running; RxJS replacement: debounceTime, switchMap, takeUntil</li><li><strong>Polling with </strong><strong>setInterval</strong>: What goes wrong: Requests overlap, and polling never stops; RxJS replacement: timer + switchMap / exhaustMap</li><li><strong>Retry loops</strong>: What goes wrong: Too many retries, no delay between them; RxJS replacement: retry({ count, delay })</li><li><strong>WebSockets with manual reconnects</strong>: What goes wrong: Duplicate connections, lost messages; RxJS replacement: webSocket + retry + share</li></ul><p>Every row follows the same idea: <strong>treat “something that happens over time” as a value that we can pass around, combine and unsubscribe from.</strong> Once both apps use Observables, the framework on each side becomes much less important.</p><h3>Why RxJS Works Well for Modernization</h3><p>There are many state management libraries. For a migration, RxJS is useful for three specific reasons:</p><ul><li><strong>It does not depend on any framework.</strong> An Observable works the same way whether jQuery, Backbone, Ember, AngularJS or React subscribes to it. This is exactly what we need during a migration, when the old and new code run on the same page.</li><li><strong>One model for every kind of async.</strong> DOM events, custom events, promises, timers, WebSockets and Node-style callbacks all become the same type. There is no need to write a different pattern for each source.</li><li><strong>Cancellation and cleanup are built in.</strong> Every subscription can be closed. Legacy apps often leave handlers and timers running, and many of these leaks are bugs that users have simply got used to.</li></ul><p>There is also one clear reason to be careful: <strong>RxJS takes time to learn</strong>, and a codebase where everything is a stream is difficult to read. We will discuss where to stop later in this post. In short, use it at the boundaries and for real event streams, not for every value in the app.</p><h3>Step 1: Wrap the Legacy Event Sources</h3><p>First, find every place where the old app produces events or async results, and create an Observable wrapper for each one. Do not change the legacy code at this stage. The wrapper only listens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gEa_-BTsuPmIyRYbk4fqqA.png" /></figure><p><strong>DOM and jQuery events.</strong> fromEvent accepts DOM elements and any object with jQuery-style on/off methods, so a jQuery object can be passed directly:</p><pre>import { fromEvent, map } from &#39;rxjs&#39;;</pre><pre>// The legacy app fires: $(document).trigger(&#39;cart:updated&#39;, [cart])<br>export const legacyCartUpdated$ = fromEvent($(document), &#39;cart:updated&#39;, (_e, cart) =&gt; cart);</pre><pre>export const searchInput$ = fromEvent&lt;InputEvent&gt;(document.querySelector(&#39;#search&#39;)!, &#39;input&#39;).pipe(<br>  map((e) =&gt; (e.target as HTMLInputElement).value),<br>);</pre><p><strong>Backbone, Ember and anything with its own add/remove API.</strong> fromEventPattern takes an add handler and a remove handler. This way, the Observable removes its listener from the legacy object properly when it is unsubscribed:</p><pre>import { fromEventPattern, startWith, map } from &#39;rxjs&#39;;</pre><pre>// Backbone model or collection<br>export const fromBackbone = &lt;T&gt;(model: Backbone.Model, event = &#39;change&#39;) =&gt;<br>  fromEventPattern&lt;Backbone.Model&gt;(<br>    (handler) =&gt; model.on(event, handler),<br>    (handler) =&gt; model.off(event, handler),<br>  ).pipe(startWith(model), map((m) =&gt; m.toJSON() as T));</pre><pre>// Ember object property (Ember.addObserver / removeObserver)<br>export const fromEmberProperty = &lt;T&gt;(obj: object, key: string) =&gt;<br>  fromEventPattern&lt;T&gt;(<br>    (handler) =&gt; addObserver(obj, key, handler),<br>    (handler) =&gt; removeObserver(obj, key, handler),<br>  ).pipe(map(() =&gt; get(obj, key) as T), startWith(get(obj, key) as T));</pre><p>Two points are important here. First, <strong>convert to plain objects at the boundary</strong> (toJSON(), get). If the stream emits Backbone models or Ember records, the new code will also start calling .get(&#39;title&#39;), and the legacy model will spread into React. This is the <a href="https://learn.microsoft.com/en-us/azure/architecture/patterns/anti-corruption-layer">anti-corruption layer</a> from our strategies post, applied to streams. Second, startWith gives the current value to late subscribers. So a React component that mounts later will not show an empty screen while it waits for the next change.</p><p><strong>Promises, callbacks and sockets</strong> also have direct wrappers:</p><pre>import { defer, bindNodeCallback } from &#39;rxjs&#39;;<br>import { webSocket } from &#39;rxjs/webSocket&#39;;</pre><pre>// defer: the request only starts when someone subscribes, and runs again per subscriber<br>export const loadOrders$ = (userId: string) =&gt; defer(() =&gt; legacyApi.getOrders(userId));</pre><pre>// Node-style callback API from an old SDK<br>export const readConfig$ = bindNodeCallback(legacySdk.readConfig);</pre><pre>export const prices$ = webSocket&lt;PriceTick&gt;(&#39;wss://example.com/prices&#39;);</pre><p>For requests, prefer defer(() =&gt; promise) over from(promise). A promise starts running as soon as it is created. defer waits until someone subscribes, and this is what makes cancellation and retries possible later.</p><h3>Step 2: Put Shared State Behind a Stream</h3><p>Wrapping the sources makes the old app observable. The next step is to give each piece of <strong>shared state</strong> (the cart, the current user, the selected account, feature flags) a single owner. This owner is a small service that holds the value and exposes it as an Observable. Both apps read from this service, and all updates go through its methods.</p><pre>import { BehaviorSubject, distinctUntilChanged, map } from &#39;rxjs&#39;;</pre><pre>export interface Cart { items: CartItem[]; total: number }</pre><pre>const state = new BehaviorSubject&lt;Cart&gt;({ items: [], total: 0 });</pre><pre>export const cartService = {<br>  cart$: state.asObservable(),<br>  count$: state.pipe(map((c) =&gt; c.items.length), distinctUntilChanged()),<br>  get value() { return state.getValue(); },</pre><pre>  add(item: CartItem) {<br>    const items = [...state.value.items, item];<br>    state.next({ items, total: sum(items) });<br>  },<br>};</pre><pre>// Keep the legacy event working for screens that still listen to it<br>cartService.cart$.subscribe((cart) =&gt; $(document).trigger(&#39;cart:updated&#39;, [cart]));</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5heI5VsdPKYLcr95t2BIHg.png" /></figure><p>The legacy side subscribes and updates the DOM the same way it does today:</p><pre>// legacy/header.js (jQuery)<br>const sub = cartService.count$.subscribe((n) =&gt; $(&#39;#cart-badge&#39;).text(n));<br>$(&#39;#add-to-cart&#39;).on(&#39;click&#39;, () =&gt; cartService.add(readItemFromForm()));</pre><pre>// Backbone view: tie the subscription to the view&#39;s lifetime<br>initialize() { this.sub = cartService.cart$.subscribe((c) =&gt; this.render(c)); },<br>remove() { this.sub.unsubscribe(); Backbone.View.prototype.remove.call(this); },</pre><p>React reads the same stream through a small hook. useSyncExternalStore is the official React API for subscribing to an external store. It also avoids the &quot;tearing&quot; issue that a useEffect + useState version can have during concurrent rendering:</p><pre>import { useSyncExternalStore } from &#39;react&#39;;<br>import type { Observable } from &#39;rxjs&#39;;</pre><pre>// Subscribe to a stream that always has a current value (like a service backed by a BehaviorSubject)<br>export function useStream&lt;T&gt;(stream$: Observable&lt;T&gt;, getValue: () =&gt; T): T {<br>  return useSyncExternalStore(<br>    (onChange) =&gt; {<br>      const sub = stream$.subscribe(onChange);<br>      return () =&gt; sub.unsubscribe();<br>    },<br>    getValue,<br>  );<br>}</pre><pre>// In a component<br>function CheckoutSummary() {<br>  const cart = useStream(cartService.cart$, () =&gt; cartService.value);<br>  return &lt;p&gt;{cart.items.length} items, {formatMoney(cart.total)}&lt;/p&gt;;<br>}</pre><p>That is the complete seam. A screen can move from the old app to React, and the cart badge in the legacy header will still update, because neither side owns the cart. Once the last legacy subscriber is removed, the service internals can be replaced (with Zustand, TanStack Query or plain React context) without changing any component, because components only depend on cart$ and add.</p><p><strong>Issues we faced</strong></p><ul><li><strong>Exposing the Subject directly.</strong> If the service exports state instead of state.asObservable(), any file can call .next(), and we are back to global events. Expose streams for reading and methods for writing.</li><li><strong>Changing emitted objects in place.</strong> state.value.items.push(item) changes the object that both apps hold, but nothing is emitted. Always emit a new object, because useSyncExternalStore depends on reference changes.</li><li><strong>Updates inside updates.</strong> A legacy handler that calls add() while handling a cart$ emission can create a loop. Using distinctUntilChanged on derived streams, and keeping the legacy re-trigger one-way, prevents most of these cases.</li><li><strong>Loops with the legacy event.</strong> If the legacy app both fires and listens to cart:updated, either wrap it with fromEvent <em>or</em> re-trigger it from the service. Do not do both.</li></ul><h3>Step 3: Replace Hand-Written Async Code with Operators</h3><p>Once events become streams, a lot of fragile legacy code can be rewritten in a few lines, and it usually becomes more correct too. A search box is the common example. Most legacy apps have some version of this jQuery code:</p><pre>let timer, lastQuery;<br>$(&#39;#search&#39;).on(&#39;input&#39;, function () {<br>  clearTimeout(timer);<br>  const q = $(this).val();<br>  timer = setTimeout(() =&gt; {<br>    if (q === lastQuery) return;<br>    lastQuery = q;<br>    $.getJSON(&#39;/api/search&#39;, { q }).done(renderResults); // a slow early response can overwrite a newer one<br>  }, 300);<br>});</pre><p>It looks fine, but it has a race condition. If the request for “rea” is slow and the request for “react” is fast, the old results arrive last and replace the correct ones. The RxJS version avoids this by design, because switchMap unsubscribes from the previous request as soon as a new query comes in:</p><pre>import { debounceTime, distinctUntilChanged, filter, switchMap, catchError, of } from &#39;rxjs&#39;;<br>import { ajax } from &#39;rxjs/ajax&#39;;</pre><pre>export const results$ = searchInput$.pipe(<br>  debounceTime(300),<br>  distinctUntilChanged(),<br>  filter((q) =&gt; q.length &gt;= 2),<br>  switchMap((q) =&gt;<br>    ajax.getJSON&lt;SearchResult[]&gt;(`/api/search?q=${encodeURIComponent(q)}`).pipe(<br>      catchError(() =&gt; of([])), // one failed search shouldn&#39;t kill the stream<br>    ),<br>  ),<br>);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yz7IuNDN9rm-mdbrWetj-w.png" /></figure><p>ajax from rxjs/ajax cancels the actual HTTP request when it is unsubscribed. With fetch, pass an AbortSignal inside new Observable (or use fromFetch from rxjs/fetch) to get the same behavior.</p><p>The same small set of operators covers most of the other hand-written patterns we see in legacy apps:</p><ul><li><strong>Only the latest request matters (search, filters, route params)</strong>: Operator: switchMap; Why it is better than the legacy version: Cancels old requests, so results never arrive out of order</li><li><strong>Ignore clicks while a save is in flight</strong>: Operator: exhaustMap; Why it is better than the legacy version: Replaces isSaving flags and disabled-button workarounds</li><li><strong>Every action must run, in order (queued writes)</strong>: Operator: concatMap; Why it is better than the legacy version: Writes do not mix, and no update is lost</li><li><strong>Poll until the user leaves the page</strong>: Operator: timer(0, 5000).pipe(switchMap(load), takeUntil(leave$)); Why it is better than the legacy version: Polls never overlap, and polling stops reliably</li><li><strong>Retry flaky calls with backoff</strong>: Operator: retry({ count: 3, delay: (_, i) =&gt; timer(2 ** i * 500) }); Why it is better than the legacy version: Limited attempts with a growing delay</li><li><strong>Combine several sources</strong>: Operator: combineLatest, withLatestFrom; Why it is better than the legacy version: Replaces flags like if (userLoaded &amp;&amp; settingsLoaded)</li><li><strong>Time out a slow call</strong>: Operator: timeout({ first: 8000 }); Why it is better than the legacy version: Configured in one place, and errors are reported properly</li></ul><p>Polling needs one more example, because legacy polling code often causes duplicate requests and battery drain:</p><pre>import { timer, defer, switchMap, takeUntil, retry, share, fromEvent, filter } from &#39;rxjs&#39;;</pre><pre>const hidden$ = fromEvent(document, &#39;visibilitychange&#39;).pipe(filter(() =&gt; document.hidden));</pre><pre>export const jobStatus$ = (jobId: string) =&gt;<br>  timer(0, 5000).pipe(<br>    switchMap(() =&gt; defer(() =&gt; api.getJob(jobId))),<br>    retry({ count: 3, delay: 1000 }),<br>    takeUntil(hidden$),<br>    share(), // several widgets can watch the same job with one poller<br>  );</pre><h3>Common Mistakes</h3><h4>Leaked subscriptions</h4><p>Every subscribe() must be closed at some point. In legacy code, connect it to the lifecycle that already exists: a Backbone view&#39;s remove, an Ember component&#39;s willDestroy, an AngularJS $scope.$on(&#39;$destroy&#39;), or a jQuery plugin&#39;s destroy. In React, the hook&#39;s cleanup takes care of it. For streams that should end on an event, keep takeUntil(destroy$) as the <strong>last</strong> operator in the pipe, so that nothing after it can subscribe again.</p><h4>Hot and cold Observables</h4><p>A cold Observable (like defer(() =&gt; fetch(...))) runs again for every subscriber. If three components subscribe to the same stream, three requests are made. When a result should be shared, add share() or shareReplay({ bufferSize: 1, refCount: true }). Use refCount: true unless the source really needs to run forever. Without it, shareReplay keeps the inner subscription (and its polling or socket) running even after the last subscriber has left.</p><h4>Turning everything into a stream</h4><p>A common mistake in RxJS projects is a codebase where a simple boolean flag becomes a BehaviorSubject&lt;boolean&gt; passed through four operators. <strong>Use streams only where time matters</strong>: events, sockets, polling, typeahead and state shared between the two apps. For normal server data in React (load a list, show it, refetch on change), <a href="https://tanstack.com/query/latest">TanStack Query</a> is simpler and also handles caching. For local component state, use useState. A simple rule: if you cannot draw a marble diagram for it, it probably should not be an Observable.</p><h4>Errors stop streams</h4><p>When an error reaches a long-running stream, the stream ends and every subscriber stops getting updates, without any visible message. Catch errors <strong>inside</strong> the switchMap/mergeMap (as shown in the search example) so that the outer stream keeps running, and log every error you catch.</p><h4>Bundle size and RxJS versions</h4><p>RxJS 7 supports tree-shaking, and from version 7.2 the operators are exported directly from rxjs. So a typical bridge layer adds only a small amount to the bundle. If the legacy app still uses RxJS 5 or 6 (common in older Angular apps), the <a href="https://rxjs.dev/deprecations/breaking-changes">official migration guide</a> explains the upgrade to 7. rxjs-compat was meant only for the 5 to 6 upgrade and should not be used in a new layer.</p><h3>Testing the Bridge</h3><p>Streams are easy to test without a browser. TestScheduler runs time-based operators on virtual time, so a 300 ms debounce does not actually wait 300 ms. Marble strings describe the input and the expected output:</p><pre>import { TestScheduler } from &#39;rxjs/testing&#39;;</pre><pre>// The search stream, with its inputs passed in instead of read from globals<br>export const searchPipeline = (input$: Observable&lt;string&gt;, search: (q: string) =&gt; Observable&lt;SearchResult[]&gt;) =&gt;<br>  input$.pipe(debounceTime(300), distinctUntilChanged(), filter((q) =&gt; q.length &gt;= 2), switchMap(search));</pre><pre>const scheduler = new TestScheduler((actual, expected) =&gt; expect(actual).toEqual(expected));</pre><pre>test(&#39;search only queries the last term after a pause&#39;, () =&gt; {<br>  scheduler.run(({ cold, expectObservable }) =&gt; {<br>    const input$ = cold(&#39;a 100ms b 400ms c|&#39;, { a: &#39;rea&#39;, b: &#39;react&#39;, c: &#39;react&#39; });<br>    const api = (q: string) =&gt; cold(&#39;--r|&#39;, { r: [`result for ${q}`] });<br>    // &#39;rea&#39; is dropped by the debounce; &#39;react&#39; settles at 401ms, its result arrives 2 frames later<br>    expectObservable(searchPipeline(input$, api)).toBe(&#39;403ms x 99ms |&#39;, { x: [&#39;result for react&#39;] });<br>  });<br>});</pre><p>Writing the pipeline as a function of its inputs is what makes it testable, and it is a good practice for the seam in any case. For checking that both apps behave the same, use the approach from our <a href="https://cobuildx.ai/blog/jquery-to-react-migration-guide">migration guides</a>: one end-to-end test suite that runs the same screen in the old app and in the new app, and checks for the same visible result. The stream layer is what keeps those results the same, so it needs good test coverage.</p><h3>Temporary Bridge or Long-Term Layer?</h3><p>At the end of the migration, decide what happens to the RxJS layer. Both options below are fine, as long as the team makes a clear decision:</p><ul><li><strong>Temporary bridge.</strong> The bridge was added so that old and new code could share state. Once the legacy app is removed, plain React state, TanStack Query or a small store can handle most of it. Remove the Subjects, and keep only the few streams that represent real events.</li><li><strong>Long-term layer.</strong> Apps with a lot of real-time behavior (trading screens, live dashboards using sockets, collaborative editors, IoT consoles) often keep RxJS as the event layer under React. In that case, document the rules: where streams are kept, how errors are handled, and which shared streams use shareReplay.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*alIWsDxEKgZeSZ7aXFYkSg.png" /></figure><p>Whichever option you choose, delete the fromEventPattern wrappers around legacy objects in the same sprint as the last legacy screen. These wrappers are always temporary.</p><h3>Further in This Series</h3><p>This post covers one technique within a larger migration plan. The posts below explain the overall plan and each starting framework in more detail:</p><ul><li><a href="https://cobuildx.ai/blog/frontend-migration-strategies">Frontend migration strategies</a>: strangler fig, branch by abstraction and vertical slicing, and how they combine.</li><li><a href="https://cobuildx.ai/blog/one-way-two-way-binding">One-way vs two-way data binding</a>: why observers and watchers are difficult to migrate, and what replaces them.</li><li>Framework guides: <a href="https://cobuildx.ai/blog/angular-to-react-migration-guide">Angular</a>, <a href="https://cobuildx.ai/blog/ember-to-react-migration-guide">Ember</a>, <a href="https://cobuildx.ai/blog/backbone-to-react-migration-guide">Backbone</a>, <a href="https://cobuildx.ai/blog/jquery-to-react-migration-guide">jQuery</a> and <a href="https://cobuildx.ai/blog/vanilla-js-to-react-migration-guide">vanilla JS</a> to React.</li></ul><h3>Our Migration Plugins</h3><p>Finding every event source, observer and shared service in a legacy app takes the most time, and it decides where the streams should go. We have packaged our approach as free, open-source plugins for Claude Code, one for each starting framework:</p><ul><li><strong>[</strong><strong>ember-to-react](https://github.com/cobuild-tech/cbx-plugins/tree/main/ember-to-react)</strong>: Migrates from: Ember Classic and Octane</li><li><strong>[</strong><strong>angular-to-react](https://github.com/cobuild-tech/cbx-plugins/tree/main/angular-to-react)</strong>: Migrates from: Angular 2+ and AngularJS 1.x, including hybrid ngUpgrade apps</li><li><strong>[</strong><strong>backbone-to-react](https://github.com/cobuild-tech/cbx-plugins/tree/main/backbone-to-react)</strong>: Migrates from: Backbone.js, Marionette, jQuery templates</li><li><strong>[</strong><strong>jquery-to-react](https://github.com/cobuild-tech/cbx-plugins/tree/main/jquery-to-react)</strong>: Migrates from: jQuery apps, plugins and jQuery UI</li><li><strong>[</strong><strong>vanillajs-to-react](https://github.com/cobuild-tech/cbx-plugins/tree/main/vanillajs-to-react)</strong>: Migrates from: Plain HTML, CSS and JavaScript</li></ul><p>Each plugin comes with a migration skill, a /&lt;plugin&gt;:plan command that writes a migration plan (strategy, units, route map, test plan and risks) without touching your code, a read-only inventory agent that maps the old app, a parity-reviewer agent that compares each migrated piece with its original, and a bundled Context7 server for up-to-date library docs. To install one in Claude Code:</p><pre>/plugin marketplace add cobuild-tech/cbx-plugins<br>/plugin install backbone-to-react@cbx-plugins</pre><p>They also work in Cursor, in VS Code with GitHub Copilot, and in the GitHub Copilot CLI. Progress is kept in a .migration/ folder in your repo, so a migration can carry on across sessions and teammates. The source and setup steps are at <a href="https://github.com/cobuild-tech/cbx-plugins">cobuild-tech/cbx-plugins</a>, and issues are welcome.</p><h3>About MigrateX</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*Fu2geOFV2dz8kI5vzTwEww.png" /></figure><p>MigrateX is our platform and service for moving software, data and infrastructure from one technology to another. It combines automation with experienced engineers. The automation does the repetitive work quickly, and the engineers make the tricky decisions, like which shared state needs a stream-based seam and which can be moved directly.</p><p>A MigrateX project usually runs like this:</p><ol><li><strong>Assessment.</strong> We map every route, shared service, event source and hidden dependency in your app, so you see where the work is before anyone agrees on a timeline.</li><li><strong>Plan.</strong> With your team, we choose the strategy, the slice order, and what can simply be deleted.</li><li><strong>Migration, step by step.</strong> Automation handles the repetitive parts. Our engineers handle the router, the seams and the code that connects old and new.</li><li><strong>Proof that it works.</strong> The same tests run against both versions. A piece only counts as moved when it passes on both.</li><li><strong>Handover.</strong> We remove the temporary code, the seams and the flags, and leave your team with a codebase they understand and own.</li></ol><p>Your app keeps running and shipping features the whole time, so there’s no big launch day. Our <a href="https://github.com/cobuild-tech/migratex-examples">migratex-examples</a> repo has small apps in each legacy framework next to their migrated versions.</p><blockquote><em>Working on the async code of a legacy app? Share a few details with us through </em><a href="https://cobuildx.ai/contact"><em>Contact Us</em></a><em>, and we will start with a free discussion on where the seams should go.</em></blockquote><h3>References</h3><p><strong>RxJS</strong></p><ul><li>RxJS. <em>Overview</em> and API reference. <a href="https://rxjs.dev/guide/overview">https://rxjs.dev/guide/overview</a></li><li>RxJS. <em>fromEventPattern</em>. <a href="https://rxjs.dev/api/index/function/fromEventPattern">https://rxjs.dev/api/index/function/fromEventPattern</a></li><li>RxJS. <em>Testing RxJS Code with Marble Diagrams</em>. <a href="https://rxjs.dev/guide/testing/marble-testing">https://rxjs.dev/guide/testing/marble-testing</a></li><li>RxJS. <em>Breaking Changes in Version 7</em>. <a href="https://rxjs.dev/deprecations/breaking-changes">https://rxjs.dev/deprecations/breaking-changes</a></li><li>Ben Lesh. <em>Hot vs Cold Observables</em>. <a href="https://benlesh.medium.com/hot-vs-cold-observables-f8094ed53339">https://benlesh.medium.com/hot-vs-cold-observables-f8094ed53339</a></li></ul><p><strong>React and migration patterns</strong></p><ul><li>React. <em>useSyncExternalStore</em>. <a href="https://react.dev/reference/react/useSyncExternalStore">https://react.dev/reference/react/useSyncExternalStore</a></li><li>Martin Fowler. <em>Branch By Abstraction</em>. <a href="https://martinfowler.com/bliki/BranchByAbstraction.html">https://martinfowler.com/bliki/BranchByAbstraction.html</a></li><li>Microsoft. <em>Anti-corruption Layer pattern</em>. <a href="https://learn.microsoft.com/en-us/azure/architecture/patterns/anti-corruption-layer">https://learn.microsoft.com/en-us/azure/architecture/patterns/anti-corruption-layer</a></li><li>TanStack Query. <em>Overview</em>. <a href="https://tanstack.com/query/latest/docs/framework/react/overview">https://tanstack.com/query/latest/docs/framework/react/overview</a></li></ul><p><strong>Source code</strong></p><ul><li>CobuildX AI. <em>cbx-plugins</em>: Claude Code plugins for Backbone, Angular, Ember, jQuery and Vanilla JS to React migrations. <a href="https://github.com/cobuild-tech/cbx-plugins">https://github.com/cobuild-tech/cbx-plugins</a></li><li>CobuildX AI. <em>migratex-examples</em>: small jQuery, Backbone, Angular, Ember and Vanilla JS apps and their migrated versions. <a href="https://github.com/cobuild-tech/migratex-examples">https://github.com/cobuild-tech/migratex-examples</a></li></ul><p><em>Originally published on the </em><a href="https://cobuildx.ai/blog/modernizing-legacy-apps-with-rxjs"><em>CobuildX blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7741453d4b9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Strangler Fig, Branch by Abstraction, Vertical Slices: Choosing a Frontend Migration Strategy]]></title>
            <link>https://medium.com/@cobuildx.ai/strangler-fig-branch-by-abstraction-vertical-slices-choosing-a-frontend-migration-strategy-582cbd52d891?source=rss-f6d64156316d------2</link>
            <guid isPermaLink="false">https://medium.com/p/582cbd52d891</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[CobuildX AI]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 06:17:23 GMT</pubDate>
            <atom:updated>2026-10-12T06:17:23.840Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yZpDjG3I1J1cPNo7ErLkmQ.png" /></figure><p><em>Strangler fig, branch by abstraction, vertical slicing: the strategy decides whether a frontend migration ships, more than the framework you move to. Here’s how each one works, where each one bites, and how we combine them on real projects.</em></p><p>Teams that plan a frontend migration spend weeks on the target: React or Vue, Next.js or Vite, Redux or TanStack Query. Then they spend almost no time on the part that decides whether it ships: <strong>how the old app and the new app will live together until the old one is gone.</strong></p><p>That part is the migration strategy. Pick the wrong one and a good framework choice still turns into an 18-month rewrite branch that never merges. Pick the right one and even a messy legacy app moves over a piece at a time, with users never noticing a launch day.</p><p>This post covers the strategies we actually use: the <strong>big-bang rewrite</strong> (as the baseline), the <strong>strangler fig</strong>, <strong>branch by abstraction</strong>, and <strong>vertical slicing</strong>, plus the supporting tactics that make them safe: parallel runs, feature flags, micro-frontends, anti-corruption layers and expand-contract. Then it shows how they fit together, because on a real project you rarely use just one. Our framework-specific guides (<a href="https://cobuildx.ai/blog/angular-to-react-migration-guide">Angular</a>, <a href="https://cobuildx.ai/blog/ember-to-react-migration-guide">Ember</a>, <a href="https://cobuildx.ai/blog/backbone-to-react-migration-guide">Backbone</a>, <a href="https://cobuildx.ai/blog/jquery-to-react-migration-guide">jQuery</a>, <a href="https://cobuildx.ai/blog/vanilla-js-to-react-migration-guide">vanilla JS</a>) go deeper on each starting point. This one is about the strategy underneath all of them.</p><h3>The Short Version</h3><ul><li><strong>Big-bang rewrite</strong>: Unit of change: The whole app; What runs side by side: Nothing in production until launch day; Rollback: Hard: the old app has gone stale; Best for: Small or frozen apps</li><li><strong>Strangler fig</strong>: Unit of change: A route or a screen; What runs side by side: Old and new apps behind one router; Rollback: Point the route back at the old app; Best for: Apps with clear routes or pages</li><li><strong>Branch by abstraction</strong>: Unit of change: A shared dependency behind a seam; What runs side by side: Old and new implementations behind one interface; Rollback: Flip the switch back; Best for: Services, stores and widgets used everywhere</li><li><strong>Vertical slicing</strong>: Unit of change: One user-facing feature, top to bottom; What runs side by side: Migrated and unmigrated features; Rollback: Per slice; Best for: Choosing the order of work</li></ul><p>The first row is the one people start with. The other three are what actually works, and they answer different questions. <strong>Strangler fig decides where the line between old and new runs. Branch by abstraction handles the things that cross that line. Vertical slicing decides what to move next.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZTueuuk_eNfI5h8CsE2dlQ.png" /></figure><h3>Big-Bang Rewrite: the Baseline</h3><p>The big-bang rewrite is the default plan nobody writes down: start a new repo, rebuild everything, switch over on a chosen day. It’s worth understanding properly, because every other strategy exists to avoid its failure modes.</p><p><strong>When it is actually right</strong></p><ul><li><strong>The app is small.</strong> A few screens that one or two people can rebuild in a few weeks. The overhead of running two apps side by side costs more than the rewrite.</li><li><strong>The app is frozen.</strong> No new features are planned, so the old app won’t move while you rebuild it.</li><li><strong>The old app can’t host anything new.</strong> Some legacy stacks make it so painful to mount new code that coexistence costs more than starting clean. This is rarer than it seems. Almost anything can serve an iframe or hand off a route.</li></ul><p><strong>Why it usually fails</strong></p><ul><li><strong>The target keeps moving.</strong> The business doesn’t stop for your rewrite. Every feature shipped in the old app is one more thing the new one has to catch up on, and the gap rarely closes.</li><li><strong>Nothing is proven until the end.</strong> Months of work with zero real users means every wrong assumption surfaces on launch day, all at once.</li><li><strong>The old app holds knowledge nobody wrote down.</strong> Ten years of bug fixes are hidden in it. Joel Spolsky called rewriting from scratch <a href="https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/">the single worst strategic mistake</a> a software company can make, for exactly this reason.</li><li><strong>Rollback is fiction.</strong> By launch day the old app is months behind. “Roll back” means going back to software everyone has stopped maintaining.</li></ul><p>The incremental strategies below all share one idea: <strong>get the new code in front of real users early, in small pieces, while the old app keeps running.</strong></p><h3>Strangler Fig</h3><p>Martin Fowler <a href="https://martinfowler.com/bliki/StranglerFigApplication.html">named this pattern</a> after a vine that grows around a host tree until the tree is gone and the vine stands on its own. In a frontend migration, the vine is the new app and the tree is the old one.</p><p><strong>How it works</strong></p><ol><li><strong>Put something in front of both apps.</strong> A reverse proxy, a CDN rule, or a thin shell app that owns the router. Every request goes through it.</li><li><strong>Send every route to the old app at first.</strong> Nothing has changed for users, but the switch now exists.</li><li><strong>Move one route.</strong> Build it in the new app and flip that one path in the router.</li><li><strong>Repeat</strong> until the old app serves nothing. Then switch it off.</li></ol><p>The routing layer can be as simple as a list of migrated paths:</p><pre>// shell/router.ts: which app owns which path<br>const MIGRATED = [&#39;/settings&#39;, &#39;/profile/:username&#39;, &#39;/article/:slug&#39;];</pre><pre>export function ownerOf(path: string): &#39;react&#39; | &#39;legacy&#39; {<br>  return MIGRATED.some((p) =&gt; matchPath(p, path)) ? &#39;react&#39; : &#39;legacy&#39;;<br>}</pre><p>In production this is often a CDN or proxy rule instead of code, and each route can sit behind a feature flag so you can roll it out to 5% of users first.</p><p><strong>Route-level or widget-level</strong></p><p>There are two grains to strangle at:</p><ul><li><strong>Route-level.</strong> Whole pages move at once. It’s the cleanest option: each page is owned by one framework, and the boundary is a URL. Start here if your app has real routes.</li><li><strong>Widget-level.</strong> New components are mounted inside old pages (a React date picker inside an Ember template, for example). This is how you migrate apps with one giant page, or a shared header that appears everywhere. It’s more fragile, because the two frameworks now share a DOM.</li></ul><p>Most projects use both: widget-level for the shared shell (nav, header, notifications), route-level for everything else.</p><p><strong>Where it shines</strong></p><ul><li><strong>Real users see real progress within weeks.</strong> Every migrated route is in production.</li><li><strong>Rollback is one line.</strong> Point the route back at the old app.</li><li><strong>Feature work never stops.</strong> New features go straight into the new app.</li><li><strong>The end is visible.</strong> “34 of 52 routes migrated” is a progress bar a manager can read.</li></ul><p><strong>Where it costs you</strong></p><ul><li><strong>Two runtimes at once.</strong> Users may download both frameworks for a while. Keep the old bundle off migrated pages where you can.</li><li><strong>Shared state across the boundary.</strong> Login, the current user, feature flags and unsaved drafts have to be readable by both apps. Put them somewhere neutral: a cookie, localStorage, or the API.</li><li><strong>CSS bleed.</strong> Global styles from one app leak into the other. Scope the new app’s styles (CSS Modules, a prefix, or Shadow DOM) before you mount anything.</li><li><strong>Navigation between apps.</strong> Crossing from a React page to an Ember page is a full page load unless the shell handles it. Users notice this, so group related routes and move them together.</li></ul><p><strong>Gotchas we hit</strong></p><ol><li><strong>The router is the hard part, not the pages.</strong> Agree on how deep links, redirects, 404s and query strings behave across both apps before moving a single route.</li><li><strong>Auth needs to move first.</strong> If the new app can’t read the old app’s session, every migrated page looks logged out. A shared cookie is the usual fix.</li><li><strong>Don’t strangle by file.</strong> Moving “all the components in /shared&quot; isn&#39;t strangling, it&#39;s a horizontal layer (see vertical slicing below). Strangle by what users see.</li><li><strong>Delete as you go.</strong> Once a route is moved and stable, remove its old code. Otherwise the old app never shrinks and you end up maintaining both forever.</li></ol><p>The <a href="https://cobuildx.ai/blog/angular-to-react-migration-guide">Angular guide</a> walks through a strangler fig migration end to end, including the shell app and the staged rollout.</p><h3>Branch by Abstraction</h3><p>Strangler fig works when the thing you’re replacing has a clear boundary, like a URL. But some parts of a frontend don’t have one. The data layer, the auth service, the API client, the store, a date library: they’re used from every page. You can’t route around them. <strong>Branch by abstraction</strong> is the pattern for those.</p><p>The name comes from Paul Hammant and is described by <a href="https://martinfowler.com/bliki/BranchByAbstraction.html">Fowler</a> and <a href="https://trunkbaseddevelopment.com/branch-by-abstraction/">trunkbaseddevelopment.com</a>. The idea: instead of making a long-lived version-control branch to replace something, you make the “branch” in the code itself, behind an interface.</p><p><strong>How it works</strong></p><ol><li><strong>Add a seam.</strong> Write an interface that describes what callers need. Make the old implementation fit it.</li><li><strong>Move callers onto the seam.</strong> One at a time, change code that talks to the old thing directly so it talks to the interface instead. Ship each change. Nothing behaves differently yet.</li><li><strong>Build the new implementation</strong> behind the same interface, in the main branch, switched off.</li><li><strong>Switch over.</strong> A flag picks the new implementation, first for internal users, then for everyone.</li><li><strong>Delete the old implementation</strong>, and the flag. If the seam isn’t useful anymore, delete it too.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KP0HXBaj2jjjxh5QmffhXg.png" /></figure><p>Here’s what that looks like for a data layer. Say pages load articles through an Ember Data store or Backbone models, and you’re replacing that with a plain API client and TanStack Query. The seam is a small repository interface:</p><pre>// articles/repository.ts: the seam<br>export interface ArticleRepository {<br>  get(slug: string): Promise&lt;Article&gt;;<br>  list(filter: ArticleFilter): Promise&lt;Article[]&gt;;<br>  save(input: ArticleInput): Promise&lt;Article&gt;;<br>}</pre><pre>// old: wraps the legacy store, converting its records to plain objects<br>export const legacyArticles: ArticleRepository = {<br>  get: async (slug) =&gt; toArticle(await store.queryRecord(&#39;article&#39;, { slug })),<br>  list: async (filter) =&gt; (await store.query(&#39;article&#39;, filter)).map(toArticle),<br>  save: async (input) =&gt; toArticle(await store.createRecord(&#39;article&#39;, input).save()),<br>};</pre><pre>// new: talks to the API directly<br>export const apiArticles: ArticleRepository = {<br>  get: (slug) =&gt; api.get(`/articles/${slug}`).then((r) =&gt; r.article),<br>  list: (filter) =&gt; api.get(&#39;/articles&#39;, filter).then((r) =&gt; r.articles),<br>  save: (input) =&gt; api.post(&#39;/articles&#39;, { article: input }).then((r) =&gt; r.article),<br>};</pre><pre>export const articles: ArticleRepository =<br>  flags.isOn(&#39;articles-api&#39;) ? apiArticles : legacyArticles;</pre><p>Two details make this work. First, <strong>the interface speaks plain objects, not framework records.</strong> If callers receive Ember Data models, they’ll keep calling .get(&#39;title&#39;) and you haven&#39;t built a seam, just a wrapper. Second, <strong>both implementations live in the main branch</strong> and are tested in CI. The &quot;branch&quot; is a flag, not a Git branch.</p><p><strong>Where you’ll use it in a frontend</strong></p><ul><li><strong>The data layer.</strong> Ember Data, Backbone collections, Angular services with their own caches → a query library. This is the most common use.</li><li><strong>Auth and session.</strong> One session interface that both the old and new apps call, so login works on both sides of the strangler boundary.</li><li><strong>A shared component.</strong> The date picker, the rich text editor, the data grid. Wrap it in one component API, then swap the implementation underneath.</li><li><strong>A library replacement</strong> that isn’t a framework change at all: moment.js → date-fns, a charting library, an HTTP client.</li></ul><p><strong>Why not just use a long-lived branch?</strong></p><p>Because a migration branch that lives for months is a big-bang rewrite in disguise. It drifts from main every day, the merge at the end is huge, and nothing in it has met a real user. Branch by abstraction keeps every step small and merged. It pairs naturally with <a href="https://trunkbaseddevelopment.com/">trunk-based development</a> and with <a href="https://martinfowler.com/articles/feature-toggles.html">feature toggles</a>.</p><p><strong>The cost:</strong> extra code for a while (the interface, two implementations and a flag), and the discipline to actually do step five. Seams and flags that outlive the migration become their own kind of legacy.</p><h3>Vertical Slicing</h3><p>Strangler fig and branch by abstraction tell you <em>how</em> to keep old and new running together. <strong>Vertical slicing tells you what to move next.</strong></p><p>A vertical slice is one user-facing feature moved <strong>top to bottom</strong>: its UI, its state, its data access, its routes and its tests, all together, until a user can do that thing entirely in the new code. The opposite is a horizontal layer: “first we’ll port all the models, then all the services, then all the components”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rCb2A10ypMJB54SmR2De7w.png" /></figure><p><strong>Why horizontal layers fail</strong></p><ul><li><strong>Nothing ships until the last layer is done.</strong> Porting every model first gives you months of code with no user, which is the big-bang problem again.</li><li><strong>You guess at requirements.</strong> Without a real screen using it, a ported service is shaped by what the old code did, not what the new UI needs.</li><li><strong>Progress is invisible.</strong> “80% of the services are done” means nothing to the people paying for it.</li></ul><p><strong>Choosing the first slice</strong></p><p>The first slice is mostly about proving the plumbing: routing between apps, shared auth, the build and deploy, the test setup. So pick one that is:</p><ul><li><strong>Real, but low-risk.</strong> A settings page or a profile page, not checkout.</li><li><strong>Light on shared dependencies.</strong> It shouldn’t need half the app’s services to render.</li><li><strong>Easy to compare.</strong> It has clear behavior you can test old against new.</li><li><strong>Used often enough</strong> that you’ll hear quickly if something’s wrong.</li></ul><p>After the first one, order the rest by <strong>value against coupling.</strong> Move high-value, loosely coupled features early. Leave the tangled core, the screen that touches everything, until the seams around it already exist.</p><p><strong>How slices map onto the other strategies</strong></p><p>In a well-run migration, a vertical slice usually <strong>is</strong> a strangler fig step: a feature is a set of routes, and moving the feature means flipping those routes. When a slice hits a dependency it shares with unmigrated features (the article store used by both the feed and the editor), that’s where a branch-by-abstraction seam goes in.</p><h3>Supporting Tactics</h3><p>These aren’t migration strategies on their own. They’re tools that make the three above safe.</p><h4>Parallel run and dark launching</h4><p>Run the new code alongside the old one in production, <strong>compare the results, but only show the old one.</strong> GitHub’s <a href="https://github.com/github/scientist">Scientist</a> library made this famous for backend code. In a frontend it’s useful for a new data layer or a new calculation (pricing, permissions, validation): call both implementations behind the seam, log any differences, return the old result. Once the differences hit zero, switch. <a href="https://martinfowler.com/bliki/DarkLaunching.html">Dark launching</a> is the same idea for whole features: ship them to production hidden, and turn them on later.</p><pre>// compare old and new behind the seam; users still get the old result<br>async function get(slug: string) {<br>  const [oldResult, newResult] = await Promise.allSettled([<br>    legacyArticles.get(slug),<br>    apiArticles.get(slug),<br>  ]);<br>  reportDiff(&#39;articles.get&#39;, oldResult, newResult);<br>  if (oldResult.status === &#39;rejected&#39;) throw oldResult.reason;<br>  return oldResult.value;<br>}</pre><p>Watch the cost: a parallel run doubles API calls. Sample a percentage of traffic, and never run both sides of a write.</p><h4>Feature flags and canary releases</h4><p>Every switch in this post (a migrated route, a new implementation behind a seam) should be a flag you can flip without a deploy. That lets you release to staff first, then 5% of users, then everyone, and roll back in seconds. Name each flag after the migration step and give it an expiry date. The <a href="https://martinfowler.com/articles/feature-toggles.html">feature toggles article</a> on Fowler’s site is the best guide to keeping them under control.</p><h4>Micro-frontends as a way to coexist</h4><p><a href="https://martinfowler.com/articles/micro-frontends.html">Micro-frontends</a> (module federation, single-spa, web components) let several apps share one page. They’re a useful <strong>vehicle</strong> for widget-level strangling: the old app becomes one micro-frontend, the new one another. But think twice before making them the <strong>destination</strong>. If the goal is one React app, use the micro-frontend setup as scaffolding and take it down when the migration ends. Otherwise you’ve swapped one legacy app for a distributed system.</p><h4>Anti-corruption layer</h4><p>An <a href="https://learn.microsoft.com/en-us/azure/architecture/patterns/anti-corruption-layer">anti-corruption layer</a> translates between the old model and the new one so the old model’s quirks don’t leak into new code. The toArticle() function in the branch-by-abstraction example is a tiny one: it turns a legacy record (with its computed properties, observers and odd field names) into a plain object the new code can trust. Keep these at the boundary and delete them when the old side is gone.</p><h4>Expand and contract</h4><p>Also called <a href="https://martinfowler.com/bliki/ParallelChange.html">parallel change</a>. When old and new code share data (an API response, a localStorage key, a URL format, a cookie), you can&#39;t change its shape in one go. <strong>Expand</strong> first: support both the old and new shapes. <strong>Migrate</strong> each reader and writer. <strong>Contract</strong>: remove the old shape once nothing uses it. It&#39;s how you rename a query parameter or restructure saved user preferences without breaking the half of the app that hasn&#39;t moved yet.</p><h3>Combining Them: the Playbook We Use</h3><p>On a real project these aren’t alternatives. They are layers of one plan:</p><ul><li><strong>Where does the line between old and new run?</strong>: Answered by: Strangler fig (routes, then widgets)</li><li><strong>What do we move next?</strong>: Answered by: Vertical slicing (value against coupling)</li><li><strong>What about things every page depends on?</strong>: Answered by: Branch by abstraction (a seam, two implementations, a flag)</li><li><strong>How do we know the new one behaves the same?</strong>: Answered by: Parallel run and shared tests</li><li><strong>How do we release and roll back?</strong>: Answered by: Feature flags and canaries</li><li><strong>How do we change shared data safely?</strong>: Answered by: Expand and contract</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fODsMh80Ed8L4eniTSoVrA.png" /></figure><p>In phases:</p><ol><li><strong>Foundation.</strong> Put the shell or proxy in front of the old app, with every route still pointing at it. Make auth work on both sides. Set up one test suite that can run against either app. Add seams around the data layer and other shared services. Nothing changes for users.</li><li><strong>First slice.</strong> Move one low-risk feature end to end. Its real job is to prove the plumbing: routing, auth, deploys, monitoring, rollback.</li><li><strong>Steady state.</strong> Move slices in order of value against coupling. Each slice is a set of routes flipped behind a flag. Switch seams to their new implementations as soon as their callers allow it, with a parallel run where correctness matters. Ship new features only in the new app.</li><li><strong>Removal.</strong> When the old app serves no routes, switch it off. Then delete the seams you no longer need, the anti-corruption layers and every migration flag. A migration isn’t done until the scaffolding is gone.</li></ol><h3>Choosing a Strategy</h3><p>If you’re deciding where to start, these questions settle most of it:</p><ul><li><strong>Is a handful of screens, or is frozen</strong>: Lean towards: Big-bang rewrite. Coexistence isn’t worth it.</li><li><strong>Has clear routes and pages</strong>: Lean towards: Strangler fig at route level</li><li><strong>Is one giant page, or has a shared shell everywhere</strong>: Lean towards: Strangler fig at widget level, often with a micro-frontend host</li><li><strong>Has a data layer, store or service every page uses</strong>: Lean towards: Branch by abstraction around it, early</li><li><strong>Has few tests</strong>: Lean towards: Write tests at the user level (end-to-end) first, then any strategy. Without them, nothing tells you a slice is done.</li><li><strong>Has many teams shipping in parallel</strong>: Lean towards: Vertical slices owned by one team each, behind flags</li><li><strong>Must keep shipping features during the migration</strong>: Lean towards: Anything except big-bang</li></ul><h3>Measuring Progress and Knowing When You’re Done</h3><p>Incremental migrations have a known failure mode: <strong>they stall at 80%.</strong> The easy routes are done, the hard core remains, and the team gets pulled onto feature work. You end up running two frameworks forever. Measuring progress openly is the best defense:</p><ul><li><strong>Routes served by the new app</strong>, as a percentage of traffic, not just a count. Ten rarely used admin pages don’t equal one home feed.</li><li><strong>Lines of legacy code left</strong>, falling every week. If it stops falling, something is wrong.</li><li><strong>Seams and flags still open.</strong> Each one is temporary and should have an owner and an end date.</li><li><strong>Parity results.</strong> For each slice: do the same tests pass against old and new, and does the parallel run show zero differences?</li></ul><p>And a short definition of done that every slice has to meet before its old code is deleted: same tests passing on both, flag at 100% for a full release cycle with no rollbacks, no remaining imports of the old code, and the old code removed in the same sprint.</p><blockquote><em>Big-bang rewrites fail on a deadline. Incremental migrations fail on discipline. Pick the failure you can manage.</em></blockquote><p><strong>Bottom line:</strong></p><ol><li><strong>Get new code in front of real users early.</strong> Every strategy that works is built on this.</li><li><strong>Strangle by what users see,</strong> route by route, not file by file.</li><li><strong>Put a seam around anything every page depends on,</strong> and switch it with a flag, not a merge.</li><li><strong>Move whole features, not layers.</strong> A finished slice ships. A finished layer doesn’t.</li><li><strong>Delete as you go,</strong> including the scaffolding. The migration ends when the seams and flags are gone, not when the last route moves.</li></ol><h3>Further in This Series</h3><p>Each of these takes the strategies above and applies them to one starting point or one design decision:</p><ul><li><a href="https://cobuildx.ai/blog/angular-to-react-migration-guide">Moving from Angular to React: A Practical Guide</a>, with the strangler fig worked end to end.</li><li><a href="https://cobuildx.ai/blog/ember-to-react-migration-guide">Leaving Ember for React: What Your Conventions Were Hiding</a>, where Ember Data is a classic branch-by-abstraction candidate.</li><li><a href="https://cobuildx.ai/blog/backbone-to-react-migration-guide">The Framework Nobody Wrote Down: Taking a Backbone App to React</a></li><li><a href="https://cobuildx.ai/blog/jquery-to-react-migration-guide">Who Updates the Total? Taking a jQuery App to React</a>, mostly widget-level strangling.</li><li><a href="https://cobuildx.ai/blog/vanilla-js-to-react-migration-guide">The State Is in the DOM: Taking a Vanilla JavaScript App to React</a></li><li><a href="https://cobuildx.ai/blog/client-patterns-mvc-mvvm">Client Patterns: MVC, MVVM, and What Came After</a></li><li><a href="https://cobuildx.ai/blog/one-way-two-way-binding">One-Way vs Two-Way Binding</a></li><li><a href="https://cobuildx.ai/blog/csr-vs-ssr">Client-Side vs Server-Side Rendering</a></li></ul><h3>Our Migration Plugins</h3><p>Choosing a strategy starts with knowing the app: every route, every shared service, every piece of hidden wiring. That map is slow to build by hand. We’ve packaged how we do it as free, open-source plugins for Claude Code, one per starting point. Each one plans an incremental, strangler-fig migration by default:</p><ul><li><strong>[</strong><strong>ember-to-react](https://github.com/cobuild-tech/cbx-plugins/tree/main/ember-to-react)</strong>: Starts from: Ember Classic and Octane</li><li><strong>[</strong><strong>angular-to-react](https://github.com/cobuild-tech/cbx-plugins/tree/main/angular-to-react)</strong>: Starts from: Angular 2+ and AngularJS 1.x, including hybrid ngUpgrade apps</li><li><strong>[</strong><strong>backbone-to-react](https://github.com/cobuild-tech/cbx-plugins/tree/main/backbone-to-react)</strong>: Starts from: Backbone.js, Marionette, jQuery templates</li><li><strong>[</strong><strong>jquery-to-react](https://github.com/cobuild-tech/cbx-plugins/tree/main/jquery-to-react)</strong>: Starts from: jQuery apps, plugins and jQuery UI</li><li><strong>[</strong><strong>vanillajs-to-react](https://github.com/cobuild-tech/cbx-plugins/tree/main/vanillajs-to-react)</strong>: Starts from: Plain HTML, CSS and JavaScript</li></ul><p>Each plugin comes with a migration skill, a /&lt;plugin&gt;:plan command that writes a migration plan (strategy, units, route map, test plan and risks) without touching your code, a read-only inventory agent that maps the old app, a parity-reviewer agent that compares each migrated piece with its original, and a bundled Context7 server for up-to-date library docs. To install one in Claude Code:</p><pre>/plugin marketplace add cobuild-tech/cbx-plugins<br>/plugin install ember-to-react@cbx-plugins</pre><p>They also work in Cursor, in VS Code with GitHub Copilot, and in the GitHub Copilot CLI. Progress is kept in a .migration/ folder in your repo, so a migration can carry on across sessions and teammates. The source and setup steps are at <a href="https://github.com/cobuild-tech/cbx-plugins">cobuild-tech/cbx-plugins</a>, and issues are welcome.</p><h3>About MigrateX</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*Fu2geOFV2dz8kI5vzTwEww.png" /></figure><p>MigrateX is our platform and service for moving software, data and infrastructure from one technology to another. It combines automation with experienced engineers. The automation does the repetitive work quickly, and the engineers make the tricky decisions, like where the strangler boundary runs and which shared services need a seam first.</p><p>A MigrateX project usually runs like this:</p><ol><li><strong>Assessment.</strong> We map every route, shared service and hidden dependency in your app, so you see where the work is before anyone agrees on a timeline.</li><li><strong>Plan.</strong> With your team, we choose the strategy, the slice order, and what can simply be deleted.</li><li><strong>Migration, step by step.</strong> Automation handles the repetitive parts. Our engineers handle the router, the seams and the code that connects old and new.</li><li><strong>Proof that it works.</strong> The same tests run against both versions. A piece only counts as moved when it passes on both.</li><li><strong>Handover.</strong> We remove the temporary code, the seams and the flags, and leave your team with a codebase they understand and own.</li></ol><p>Your app keeps running and shipping features the whole time, so there’s no big launch day. Our <a href="https://github.com/cobuild-tech/migratex-examples">migratex-examples</a> repo has small apps in each legacy framework next to their migrated versions.</p><blockquote><em>Planning a migration and not sure which strategy fits? Tell us a little about your app through </em><a href="https://cobuildx.ai/contact"><em>Contact Us</em></a><em>, and we’ll start with a free chat about where the work is likely to be.</em></blockquote><h3>References</h3><p><strong>Further reading</strong></p><ul><li>Martin Fowler. <em>Strangler Fig Application</em>. <a href="https://martinfowler.com/bliki/StranglerFigApplication.html">https://martinfowler.com/bliki/StranglerFigApplication.html</a></li><li>Martin Fowler. <em>Branch By Abstraction</em>. <a href="https://martinfowler.com/bliki/BranchByAbstraction.html">https://martinfowler.com/bliki/BranchByAbstraction.html</a></li><li>Paul Hammant. <em>Branch by Abstraction</em>. <a href="https://www.branchbyabstraction.com/">https://www.branchbyabstraction.com/</a></li><li>Trunk Based Development. <em>Branch by Abstraction</em>. <a href="https://trunkbaseddevelopment.com/branch-by-abstraction/">https://trunkbaseddevelopment.com/branch-by-abstraction/</a></li><li>Danilo Sato. <em>Parallel Change</em>. <a href="https://martinfowler.com/bliki/ParallelChange.html">https://martinfowler.com/bliki/ParallelChange.html</a></li><li>Ian Cartwright, Rob Horn and James Lewis. <em>Patterns of Legacy Displacement</em>. <a href="https://martinfowler.com/articles/patterns-legacy-displacement/">https://martinfowler.com/articles/patterns-legacy-displacement/</a></li><li>Pete Hodgson. <em>Feature Toggles (aka Feature Flags)</em>. <a href="https://martinfowler.com/articles/feature-toggles.html">https://martinfowler.com/articles/feature-toggles.html</a></li><li>Cam Jackson. <em>Micro Frontends</em>. <a href="https://martinfowler.com/articles/micro-frontends.html">https://martinfowler.com/articles/micro-frontends.html</a></li><li>Microsoft. <em>Strangler Fig pattern</em>. <a href="https://learn.microsoft.com/en-us/azure/architecture/patterns/strangler-fig">https://learn.microsoft.com/en-us/azure/architecture/patterns/strangler-fig</a></li><li>Microsoft. <em>Anti-corruption Layer pattern</em>. <a href="https://learn.microsoft.com/en-us/azure/architecture/patterns/anti-corruption-layer">https://learn.microsoft.com/en-us/azure/architecture/patterns/anti-corruption-layer</a></li><li>GitHub. <em>Scientist</em>: a library for carefully refactoring critical paths. <a href="https://github.com/github/scientist">https://github.com/github/scientist</a></li><li>Joel Spolsky. <em>Things You Should Never Do, Part I</em>. <a href="https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/">https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/</a></li><li>Sam Newman. <em>Monolith to Microservices</em>. O’Reilly, 2019. <a href="https://samnewman.io/books/monolith-to-microservices/">https://samnewman.io/books/monolith-to-microservices/</a></li></ul><p><strong>Source code</strong></p><ul><li>CobuildX AI. <em>cbx-plugins</em>: Claude Code plugins for Backbone, Angular, Ember, jQuery and Vanilla JS to React migrations. <a href="https://github.com/cobuild-tech/cbx-plugins">https://github.com/cobuild-tech/cbx-plugins</a></li><li>CobuildX AI. <em>migratex-examples</em>: small jQuery, Backbone, Angular, Ember and Vanilla JS apps and their migrated versions. <a href="https://github.com/cobuild-tech/migratex-examples">https://github.com/cobuild-tech/migratex-examples</a></li></ul><p><em>Originally published on the </em><a href="https://cobuildx.ai/blog/frontend-migration-strategies"><em>CobuildX blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=582cbd52d891" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CSR vs SSR: Client vs Server-Side Rendering & Migration]]></title>
            <link>https://medium.com/@cobuildx.ai/csr-vs-ssr-client-vs-server-side-rendering-migration-f1a2e08907f8?source=rss-f6d64156316d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1a2e08907f8</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[ssr-vs-csr]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[CobuildX AI]]></dc:creator>
            <pubDate>Thu, 08 Oct 2026 10:09:18 GMT</pubDate>
            <atom:updated>2026-10-08T10:09:18.166Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WCa2Rl-BpJKiI7ab.png" /></figure><p><em>Client-side rendering builds the page in the browser. Server-side rendering builds it on the server. Here’s how each one works, where each one bites, and the playbooks we use to move a React app from CSR to SSR, and from SSR back to CSR.</em></p><p>Every web page has to be turned into HTML somewhere. Rendering is just the answer to one question: <strong>where does that happen, in the user’s browser or on your server?</strong></p><p>There are two answers, client-side rendering (CSR) and server-side rendering (SSR), and neither one is “the old way”. Teams move in both directions: a React SPA that suddenly needs SEO moves to SSR, and a Next.js app that turned into a logged-in dashboard moves back to a plain SPA to cut servers and complexity.</p><p>So this post goes in four parts: client-side rendering on its own, server-side rendering on its own, then migrating <strong>CSR → SSR</strong>, and migrating <strong>SSR → CSR</strong>. The examples come from the React apps in our <a href="https://github.com/cobuild-tech/migratex-examples">migratex-examples</a> repo, which are all client-rendered today.</p><h3>The Short Version</h3><ul><li><strong>Where HTML is built</strong>: Client-side (CSR): In the browser, by JavaScript; Server-side (SSR): On the server, per request (or at build time)</li><li><strong>What the first response holds</strong>: Client-side (CSR): An empty &lt;div id=&quot;root&quot;&gt; and a script tag; Server-side (SSR): The finished page</li><li><strong>First thing the user sees</strong>: Client-side (CSR): A blank page or a spinner; Server-side (SSR): Real content</li><li><strong>Hosting</strong>: Client-side (CSR): Static files on any CDN; Server-side (SSR): A Node (or edge) server, or a build step</li><li><strong>Best at</strong>: Client-side (CSR): Long sessions behind a login; Server-side (SSR): Public pages that must load fast and rank</li><li><strong>Main risk</strong>: Client-side (CSR): Slow first load, invisible to crawlers; Server-side (SSR): Code that assumes a browser, hydration mismatches</li></ul><p>Both end with the same interactive React app in the browser. The real difference is <strong>what the user gets before your JavaScript runs.</strong></p><h3>Client-Side Rendering</h3><h4>How it works</h4><p>With CSR, the server is just a file host. It sends the same small index.html for every URL, and the browser does all the work:</p><ol><li>The browser asks for /article/hello-world and gets back index.html with an empty &lt;div id=&quot;root&quot;&gt;.</li><li>It downloads and runs the JavaScript bundle.</li><li>React starts, the router reads the URL, and the page asks the API for the article.</li><li>When the JSON arrives, React builds the HTML in the browser. Only now does the user see the article.</li></ol><p>Our <a href="https://github.com/cobuild-tech/migratex-examples/tree/main/ember-react/react-js">Ember-to-React blogging app</a> is a typical one. Its whole entry point is a createRoot call in <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/main.tsx">main.tsx</a>:</p><pre>import { createRoot } from &#39;react-dom/client&#39;;<br> <br>createRoot(document.getElementById(&#39;root&#39;)!).render(<br>  &lt;App /&gt;<br>);</pre><p>Everything after that runs in the browser. Pages fetch their own data with TanStack Query hooks like <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/hooks/queries.ts">useArticle(slug)</a>, and the login token lives in localStorage. After the first load, clicking a link never goes back to the server for HTML. The router swaps components and fetches only the JSON it needs.</p><h4>Where it shines</h4><ul><li><strong>Hosting is boring.</strong> The build is a folder of static files. Put it on any CDN and it scales for free.</li><li><strong>Navigation is instant.</strong> Once loaded, moving between pages feels like a desktop app.</li><li><strong>One environment.</strong> Your code always runs in a browser, so window, localStorage and document are always there.</li><li><strong>A clean API boundary.</strong> The frontend only talks to a JSON API, which mobile apps and partners can share.</li></ul><h4>Where it costs you</h4><ul><li><strong>Slow first load.</strong> Nothing shows until the bundle downloads, runs and fetches data. On a cheap phone over a weak network, that’s seconds of white screen.</li><li><strong>Crawlers and link previews see nothing.</strong> Google can run JavaScript, slowly and not always. Slack, LinkedIn and X previews mostly don’t, so every shared link shows the same generic title.</li><li><strong>Request waterfalls.</strong> Code loads, then data loads, then a child component loads more data. Each step waits for the one before.</li><li><strong>The bundle only grows.</strong> Every feature adds JavaScript that every visitor downloads before seeing anything.</li></ul><h3>Server-Side Rendering</h3><h4>How it works</h4><p>With SSR, the server runs your React components first. It fetches the data, renders the page to an HTML string and sends it. The user sees the article right away. Then the same JavaScript loads in the browser and <strong>hydrates</strong> the page: React walks the existing HTML, attaches event handlers, and takes over from there.</p><p>Under every framework, it comes down to two calls, one on each side:</p><pre>// server: build the HTML for this request<br>import { renderToPipeableStream } from &#39;react-dom/server&#39;;<br> <br>const article = await api.getArticle(slug);<br>renderToPipeableStream(&lt;App article={article} /&gt;).pipe(res);<br> <br>// browser: adopt the HTML that is already there<br>import { hydrateRoot } from &#39;react-dom/client&#39;;<br> <br>hydrateRoot(document.getElementById(&#39;root&#39;)!, &lt;App article={window.__DATA__} /&gt;);</pre><p>Notice the browser does not fetch the article again. The server sends the data along with the HTML (window.__DATA__ here), so both sides render from the same input. In practice a framework does this wiring for you: <a href="https://nextjs.org/docs">Next.js</a> or <a href="https://reactrouter.com/start/framework/installation">React Router in framework mode</a> (the Remix successor).</p><h4>SSR is a family</h4><p>“Server-side” covers a few strategies. The difference is <strong>when</strong> the HTML is built:</p><ul><li><strong>Static generation (SSG)</strong>: HTML is built: Once, at build time; Good for: Docs, marketing pages, blog posts</li><li><strong>Incremental regeneration (ISR)</strong>: HTML is built: At build, then refreshed in the background; Good for: Product pages, large catalogs</li><li><strong>Per-request SSR</strong>: HTML is built: On every request; Good for: Personalized or fast-changing pages</li><li><strong>Streaming SSR</strong>: HTML is built: Per request, sent in chunks as data arrives; Good for: Pages with one slow section</li><li><strong>React Server Components</strong>: HTML is built: On the server, and some components never ship JS at all; Good for: Content-heavy apps with small interactive parts</li></ul><p>Most real apps mix them: static marketing pages, per-request article pages, and a client-rendered editor behind the login.</p><h4>Where it shines</h4><ul><li><strong>Content on first paint.</strong> The user reads the page while the JavaScript is still loading.</li><li><strong>Crawlers and previews just work.</strong> Every URL returns real HTML with its own title and meta tags.</li><li><strong>Data is fetched close to the API.</strong> The server talks to your backend over a fast network, often in parallel, instead of a phone making the same calls over 4G.</li><li><strong>Secrets stay on the server.</strong> API keys and database calls in server code never reach the browser.</li></ul><h4>Where it costs you</h4><ul><li><strong>Your code now runs in two places.</strong> Anything that touches window, document or localStorage while rendering crashes on the server.</li><li><strong>Hydration mismatches.</strong> If the server and browser render different HTML (a timestamp, a random id, a saved theme), React warns and may throw away the server HTML.</li><li><strong>You run servers again.</strong> Per-request SSR needs a Node or edge runtime, with its cold starts, scaling and monitoring.</li><li><strong>Fast to see is not fast to use.</strong> The page looks ready before hydration finishes, so early clicks can do nothing. Heavy pages still pay the full JavaScript cost.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*shXZZH8_UscTY_kH.png" /></figure><h3>Before You Migrate: Do You Need To?</h3><p>Rendering is an all-or-nothing choice less often than people think. Two cheaper fixes cover a lot of cases:</p><ul><li><strong>Only link previews are broken?</strong> Inject per-page meta tags at the edge. This very site is a Vite SPA, and a small <a href="https://developers.cloudflare.com/pages/functions/middleware/">Cloudflare Pages middleware</a> rewrites the &lt;title&gt; and Open Graph tags for each URL before the HTML goes out. No SSR needed.</li><li><strong>Only a few public pages need to be fast and indexable?</strong> Prerender those routes to static HTML at build time and leave the rest of the app client-rendered.</li></ul><p>Migrate the rendering model when the problem is the whole app: first-load speed on real devices, SEO across thousands of pages, or (going the other way) servers and complexity you no longer need.</p><h3>Migrating CSR → SSR</h3><p>This is the “our SPA needs SEO and a faster first load” direction. You don’t need a rewrite. Your components stay React components. What changes is <strong>where data is fetched, where auth lives, and which code is allowed to touch the browser.</strong> Here’s how each piece of a client-rendered app maps:</p><ul><li><strong>createRoot(...).render(&lt;App /&gt;)</strong>: SSR (target): Framework entry with hydrateRoot; From our repo: <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/main.tsx">main.tsx</a></li><li><strong>useQuery fetching in the browser</strong>: SSR (target): Route loader (or server component) fetches; the client cache is seeded from it; From our repo: <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/hooks/queries.ts">queries.ts</a></li><li><strong>Token in </strong><strong>localStorage</strong>: SSR (target): HttpOnly session cookie the server can read; From our repo: <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/session/SessionContext.tsx">SessionContext.tsx</a></li><li><strong>Theme read from </strong><strong>localStorage on render</strong>: SSR (target): Theme in a cookie, or a tiny inline script before paint; From our repo: <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/vanillajs-react/react-js/src/hooks/useTheme.ts">useTheme.ts</a></li><li><strong>DOMPurify on the rendered markdown</strong>: SSR (target): A sanitizer that runs without a DOM, on the server too; From our repo: <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/lib/markdown.ts">markdown.ts</a></li><li><strong>&lt;RequireAuth&gt; redirecting in the browser</strong>: SSR (target): A redirect in the loader, before any HTML is sent; From our repo: <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/routes/RequireAuth.tsx">RequireAuth.tsx</a></li></ul><p>The order we follow:</p><ol><li><strong>Pick the framework by your router.</strong> Already on React Router? Its framework mode keeps your route tree and adds loaders. Starting fresh or want Server Components? Next.js.</li><li><strong>Turn SSR on with no data first.</strong> Get every route rendering on the server, even if it shows a loading state. This flushes out all the browser-only code in one pass.</li><li><strong>Move data fetching into loaders, route by route.</strong> Start with the public, SEO-critical pages: article, profile, home feed.</li><li><strong>Move auth into a cookie.</strong> Until the server knows who the user is, every logged-in page can only render as “logged out”.</li><li><strong>Add per-page titles and meta tags.</strong> That’s half the reason you came.</li><li><strong>Measure with real numbers.</strong> Compare Largest Contentful Paint and Interaction to Next Paint before and after, on a mid-range phone.</li></ol><p>Step three in practice. In React Router framework mode, the article route fetches on the server and the component just reads the result:</p><pre>// routes/article.tsx<br>export async function loader({ params }: Route.LoaderArgs) {<br>  return { article: await api.getArticle(params.slug) };<br>}<br> <br>export function meta({ data }: Route.MetaArgs) {<br>  return [{ title: data.article.title }];<br>}<br> <br>export default function Article({ loaderData }: Route.ComponentProps) {<br>  return &lt;ArticleView article={loaderData.article} /&gt;;<br>}</pre><p>If you’d rather keep TanStack Query, prefetch on the server with queryClient.prefetchQuery and pass the cache down with dehydrate / HydrationBoundary. Your existing useArticle(slug) hooks then find their data already in the cache and don&#39;t fetch again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2HsJ1T2fuzrb5FQd.png" /></figure><h4>Gotchas we hit</h4><p>A client-rendered app quietly assumes it’s in a browser everywhere. Each of these lines was fine yesterday:</p><ol><li><strong>localStorage during render.</strong> <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/session/SessionContext.tsx">SessionContext</a> reads the token in a useState initializer, which also runs on the server. The try/catch around it hides the crash, but then the server always renders &quot;logged out&quot; and the browser renders &quot;logged in&quot;: a mismatch. The fix is a cookie the server can read, not a better try/catch.</li><li><strong>The flash of the wrong theme.</strong> <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/vanillajs-react/react-js/src/hooks/useTheme.ts">useTheme</a> reads the saved theme on render too. The server can&#39;t see localStorage, so it sends light mode and dark-mode users get a white flash. Store the theme in a cookie, or set data-theme from a tiny inline script in &lt;head&gt; before the page paints.</li><li><strong>Libraries that need a DOM.</strong> DOMPurify needs window. If the server must render article bodies (and for SEO it must), switch to a sanitizer that runs in Node, like isomorphic-dompurify or sanitize-html.</li><li><strong>Different output on each side.</strong> new Date().toLocaleString(), Math.random() ids and &quot;5 minutes ago&quot; labels all render differently on the server. Use useId() for ids, format dates in a fixed time zone, and fill in relative times in an effect after hydration.</li><li><strong>Browser-only APIs belong in effects or handlers.</strong> window.confirm in the <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/components/ArticleForm.tsx">article editor</a> is fine, because it only runs on a click. The rule: render must be pure. Anything that needs the browser goes in useEffect or an event handler.</li><li><strong>Your API now gets called from two places.</strong> Server requests come from your server’s IP, not the user’s. CORS, rate limits and IP allow-lists may all need updating, and the server must forward the user’s session explicitly.</li></ol><p>None of these are about markup. They’re all about <strong>which environment your code is running in.</strong></p><h3>Migrating SSR → CSR</h3><p>The other direction is more common than people admit. A product starts as a Next.js site, grows into a dashboard that only logged-in users ever see, and the team is now paying for servers, cold starts and hydration bugs to render pages Google will never visit. Going back to a static SPA trades first-load speed for simple hosting and one runtime.</p><p>Both big frameworks let you do this without leaving them. Next.js has output: &#39;export&#39;, which builds a static site with no server. React Router framework mode has ssr: false, which builds a SPA from the same routes. That makes this a good first step: switch rendering off, keep the framework, and fix what breaks.</p><ul><li><strong>loader / </strong><strong>getServerSideProps / async server component</strong>: CSR (target): useQuery in the component, or a client loader; Keep in mind: You now need loading and error states the server used to hide.</li><li><strong>Session read from </strong><strong>cookies() on the server</strong>: CSR (target): Same cookie, but checked by your API on each call; Keep in mind: The browser can&#39;t read an HttpOnly cookie, and that&#39;s fine. Ask the API who the user is.</li><li><strong>Middleware redirecting logged-out users</strong>: CSR (target): A route guard like &lt;RequireAuth&gt;; Keep in mind: A guard is UX, not security. Your API must still reject the request.</li><li><strong>Secrets and DB calls in server code</strong>: CSR (target): A backend endpoint the SPA calls; Keep in mind: Anything left in a component ships to every visitor’s browser.</li><li><strong>Per-page </strong><strong>&lt;title&gt; and meta from the server</strong>: CSR (target): Edge meta injection, or prerender the public pages; Keep in mind: Skip this and every shared link shows the same preview.</li><li><strong>Server Components with no client JS</strong>: CSR (target): Regular components in the bundle; Keep in mind: The bundle grows. Split by route with lazy().</li></ul><h4>Gotchas in this direction</h4><ol><li><strong>Find every server-only import before you flip the switch.</strong> A component that imports your database client or reads process.env.API_SECRET will either fail the build or, worse, bundle the secret into public JavaScript. Grep for them and move them behind an API first.</li><li><strong>Every page needs a loading state now.</strong> On the server, a page simply waited for its data. In the browser, it renders first and waits after, so empty states, spinners and error messages you never needed suddenly appear.</li><li><strong>Deep links need a fallback.</strong> A static host must serve index.html for /article/hello-world, or every refresh outside the home page is a 404. Configure the SPA fallback on your CDN.</li><li><strong>Don’t lose the public pages’ SEO by accident.</strong> If the app still has a landing page, pricing or public profiles, keep those prerendered or keep a small SSR site for them. Only the logged-in part needs to become a SPA.</li><li><strong>Check your Core Web Vitals after the move.</strong> First load will get slower. Make sure it’s still acceptable on a mid-range phone, then claw time back with code splitting and preloading the first data request.</li></ol><h3>So Which One Wins?</h3><p>Neither. The deciding question is not the framework, it’s the <strong>audience of each page.</strong> A stranger arriving from Google or a shared link judges you on the first second, and a crawler has to read the page. A logged-in user who keeps your app open all day cares about instant navigation, not first paint.</p><p>So the rule we follow in both directions: <strong>render on the server what strangers see first, render in the browser what members use all day.</strong> For most products that means a mix: SSR or static pages for the public side, a client-rendered app behind the login, and one framework that can do both.</p><blockquote><em>Server-render what strangers see first. Client-render what members use all day.</em></blockquote><p><strong>Bottom line:</strong> whichever way you’re migrating, take these habits with you:</p><ol><li><strong>Render must be pure.</strong> No window, localStorage or random values while rendering. Browser work goes in effects and handlers. Code written this way can move in either direction.</li><li><strong>Auth lives in a cookie your API checks.</strong> It works for SSR, CSR and everything in between.</li><li><strong>Data fetching sits at the route, not deep in the tree.</strong> Route-level loaders or prefetches avoid waterfalls in both models.</li><li><strong>Decide per route, not per app.</strong> Mixed rendering is normal. Use a framework that lets each route choose.</li><li><strong>Measure before and after.</strong> LCP, INP and search impressions, on real devices. That’s how you know the migration paid off.</li></ol><h3>Our Migration Plugins</h3><p>Most legacy frontends we migrate are client-rendered, or are server-rendered pages with JavaScript bolted on top. Mapping every route, every bit of browser-only code and every data fetch before choosing a rendering model is slow work by hand. We’ve packaged how we do it as free, open-source plugins for Claude Code, one per starting point:</p><ul><li><a href="https://github.com/cobuild-tech/cbx-plugins/tree/main/ember-to-react"><strong>ember-to-react</strong></a>: Starts from: Ember Classic and Octane; How it renders today: Client-side, with optional FastBoot SSR</li><li><a href="https://github.com/cobuild-tech/cbx-plugins/tree/main/angular-to-react"><strong>angular-to-react</strong></a>: Starts from: Angular 2+ and AngularJS 1.x; How it renders today: Client-side, with optional Angular SSR</li><li><a href="https://github.com/cobuild-tech/cbx-plugins/tree/main/backbone-to-react"><strong>backbone-to-react</strong></a>: Starts from: Backbone.js, Marionette, jQuery templates; How it renders today: Client-side views, often on server-rendered pages</li><li><a href="https://github.com/cobuild-tech/cbx-plugins/tree/main/jquery-to-react"><strong>jquery-to-react</strong></a>: Starts from: jQuery apps, plugins and jQuery UI; How it renders today: Server-rendered pages enhanced in the browser</li><li><a href="https://github.com/cobuild-tech/cbx-plugins/tree/main/vanillajs-to-react"><strong>vanillajs-to-react</strong></a>: Starts from: Plain HTML, CSS and JavaScript; How it renders today: Static HTML plus scripts</li></ul><p>Each plugin comes with a migration skill, a /&lt;plugin&gt;:plan command that writes a migration plan without touching your code, a read-only inventory agent that maps the old app, a parity-reviewer agent that compares each migrated piece with its original, and a bundled Context7 server for up-to-date library docs. To install one in Claude Code:</p><pre>/plugin marketplace add cobuild-tech/cbx-plugins<br>/plugin install ember-to-react@cbx-plugins</pre><p>They also work in Cursor, in VS Code with GitHub Copilot, and in the GitHub Copilot CLI. Progress is kept in a .migration/ folder in your repo, so a migration can carry on across sessions and teammates. The source and setup steps are at <a href="https://github.com/cobuild-tech/cbx-plugins">cobuild-tech/cbx-plugins</a>, and issues are welcome.</p><h3>About MigrateX</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/0*_Kh2kHdhOo-P6f7i.png" /></figure><p>MigrateX is our platform and service for moving software, data and infrastructure from one technology to another. It combines automation with experienced engineers. The automation does the repetitive work quickly, and the engineers make the tricky decisions, like which routes should render on the server and where the session should live.</p><p>A MigrateX project usually runs like this:</p><ol><li><strong>Assessment.</strong> We map every route, data fetch and piece of browser-only code in your app, so you see where the work is before anyone agrees on a timeline.</li><li><strong>Plan.</strong> With your team, we decide which pages render where, what moves first, and what can simply be deleted.</li><li><strong>Migration, step by step.</strong> Automation handles the repetitive parts. Our engineers handle data loading, auth and the code that connects old and new.</li><li><strong>Proof that it works.</strong> The same tests run against both versions, and we compare load times on real devices. A piece only counts as moved when it passes on both.</li><li><strong>Handover.</strong> We remove the temporary code and leave your team with a codebase they understand and own.</li></ol><p>Your app keeps running and shipping features the whole time, so there’s no big launch day. The examples in this post come from our <a href="https://github.com/cobuild-tech/migratex-examples">migratex-examples</a> repo, which has each small app next to its migrated version.</p><blockquote><em>SPA that needs SEO, or an SSR app that doesn’t need its servers? Tell us a little about it through </em><a href="https://cobuildx.ai/contact"><em>Contact Us</em></a><em>, and we’ll start with a free chat about where the work is likely to be.</em></blockquote><p><strong>Further reading</strong></p><ul><li>web.dev. <em>Rendering on the Web</em>. <a href="https://web.dev/articles/rendering-on-the-web">https://web.dev/articles/rendering-on-the-web</a></li><li>React. <em>hydrateRoot</em>. <a href="https://react.dev/reference/react-dom/client/hydrateRoot">https://react.dev/reference/react-dom/client/hydrateRoot</a></li><li>React Router. <em>Rendering Strategies</em>. <a href="https://reactrouter.com/start/framework/rendering">https://reactrouter.com/start/framework/rendering</a></li><li>Next.js. <em>Static Exports</em>. <a href="https://nextjs.org/docs/app/guides/static-exports">https://nextjs.org/docs/app/guides/static-exports</a></li><li>TanStack Query. <em>Server Rendering &amp; Hydration</em>. <a href="https://tanstack.com/query/latest/docs/framework/react/guides/ssr">https://tanstack.com/query/latest/docs/framework/react/guides/ssr</a></li><li>Cloudflare. <em>Pages Functions middleware</em>. <a href="https://developers.cloudflare.com/pages/functions/middleware/">https://developers.cloudflare.com/pages/functions/middleware/</a></li></ul><p><strong>Source code</strong></p><ul><li>CobuildX AI. <em>cbx-plugins</em>: Claude Code plugins for Backbone, Angular, Ember, jQuery and Vanilla JS to React migrations. <a href="https://github.com/cobuild-tech/cbx-plugins">https://github.com/cobuild-tech/cbx-plugins</a></li><li>CobuildX AI. <em>migratex-examples</em>: small jQuery, Backbone, Angular, Ember and Vanilla JS apps and their migrated versions. <a href="https://github.com/cobuild-tech/migratex-examples">https://github.com/cobuild-tech/migratex-examples</a></li></ul><p><em>Originally published on the </em><a href="https://cobuildx.ai/blog/csr-vs-ssr"><em>CobuildX blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1a2e08907f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One-Way vs Two-Way Data Binding: Migrating to React]]></title>
            <link>https://medium.com/@cobuildx.ai/one-way-vs-two-way-data-binding-migrating-to-react-f1313fd71fac?source=rss-f6d64156316d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1313fd71fac</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[CobuildX AI]]></dc:creator>
            <pubDate>Thu, 08 Oct 2026 10:03:27 GMT</pubDate>
            <atom:updated>2026-10-08T10:12:36.694Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rtkt1jwU6i1PIPOF.png" /></figure><p><em>Two-way binding makes forms feel like magic. One-way binding makes every change easy to trace. Here’s how each one works, where each one bites, and the playbooks we use to migrate forms from two-way to one-way, and from one-way back to two-way.</em></p><p>Every form keeps two copies of the same value: one in your JavaScript state, one sitting in the input box on screen. Binding is just the answer to one question: who keeps these two in sync?</p><p>There are two answers, two-way and one-way, and neither one is “the old way”. Angular, Ember and Vue lean two-way. React is strictly one-way. Teams move in both directions: Ember and AngularJS apps move to React, and React apps move to Angular or Vue, or just pick up a form library that puts the two-way feel back.</p><p>So this post goes in four parts: two-way binding on its own, one-way binding on its own, then migrating <strong>two-way → one-way</strong>, and migrating <strong>one-way → two-way</strong>. The examples come from the Ember, Angular and React apps in our <a href="https://github.com/cobuild-tech/migratex-examples">migratex-examples</a> repo.</p><h3>The Short Version</h3><ul><li><strong>Who writes the state</strong>: Two-way: The input and your code; One-way: Only your code</li><li><strong>Typical syntax</strong>: Two-way: [(ngModel)], &lt;Input @value&gt;, v-model; One-way: value + onChange</li><li><strong>Glue code</strong>: Two-way: None; One-way: A setter per field (or one shared helper)</li><li><strong>Where changes come from</strong>: Two-way: Anything bound to the value; One-way: One setter you can search for</li><li><strong>Best at</strong>: Two-way: Small, local forms; One-way: Shared state and big apps</li><li><strong>Main risk</strong>: Two-way: Editing data you don’t own; One-way: Boilerplate and forgotten handlers</li></ul><p>Both keep the screen and the data in sync. The real difference is <strong>who is allowed to write</strong>.</p><h3>Two-Way Binding</h3><h4>How it works</h4><p>With two-way binding, the input and the state are glued together. Type in the box and the variable changes. Change the variable and the box changes. You write no glue code.</p><p>Angular makes it one line. In our <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/angular-react/angular-js/src/app/app.component.html">Angular todo app</a>, the title input and the type dropdown are wired like this:</p><pre>&lt;input name=&quot;title&quot; [(ngModel)]=&quot;title&quot; /&gt;<br>&lt;select name=&quot;type&quot; [(ngModel)]=&quot;type&quot;&gt;...&lt;/select&gt;</pre><p>That “banana in a box” syntax is actually sugar for two one-way bindings: [ngModel]=&quot;title&quot; pushes the value down, and (ngModelChange)=&quot;title = $event&quot; writes it back. Angular just hides the second half from you. Vue&#39;s v-model works the same way: a :value plus an @input.</p><p>Ember does it with the built-in &lt;Input&gt; component. Our <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/ember-js/app/components/login-form.hbs">Ember login form</a> is just:</p><pre>&lt;Input type=&quot;text&quot; @value={{this.email}} /&gt;<br>&lt;Input type=&quot;password&quot; @value={{this.password}} /&gt;</pre><p>&lt;Input&gt; writes every keystroke straight back into this.email. No handler, no setter, nothing.</p><h4>Where it shines</h4><ul><li><strong>Small forms are tiny.</strong> A login form, a search box or a settings toggle needs no handler code at all.</li><li><strong>The template reads like the data.</strong> You can see what each field edits just by looking at the markup.</li><li><strong>Validation comes built in.</strong> Angular’s ngModel tracks dirty, touched and valid for each field for free.</li></ul><h4>Where it bites</h4><p>The trouble starts when you bind to something that isn’t yours. Look at our <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/ember-js/app/components/article-form.hbs">Ember article editor</a>:</p><pre>&lt;Input @value={{this.article.title}} /&gt;<br>&lt;Input @value={{this.article.description}} /&gt;<br>&lt;Textarea @value={{this.article.body}} /&gt;</pre><p>this.article is not a local copy. It&#39;s the actual ember-data record from the store, the same object every other screen reads. So every keystroke edits the shared, cached article before anyone clicks Publish. Start editing a title, leave without saving, and the record in the store still carries your half-typed change.</p><p>To keep this under control, the <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/ember-js/app/components/article-form.js">component</a> needs extra machinery:</p><ul><li>hasDirtyAttributes to know whether anything changed, so the Publish button can enable itself.</li><li>unloadRecord() in willDestroy to throw away a new article that was never saved.</li><li>A keyup handler, processTags, to keep the rawTagList text and the record&#39;s tagList array in sync.</li></ul><p>Same story one level up. <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/ember-js/app/components/comments-section.js">comments-section.js</a> does this.args.article.set(&#39;comments&#39;, comments), so a child component quietly changes data its parent owns. It works fine, until someone asks &quot;who set this value?&quot; and nobody can answer without a debugger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OEjgFft4R3qS5Rpq.png" /></figure><h3>One-Way Binding</h3><h4>How it works</h4><p>With one-way binding, state flows down into the view, and the view can’t touch it. An input shows whatever state says, and typing only fires an event. Your code decides what to do with that event. Here’s the same login form in <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/components/LoginForm.tsx">React</a>:</p><pre>const [email, setEmail] = useState(&#39;&#39;);<br> <br>&lt;input value={email} onChange={(e) =&gt; setEmail(e.target.value)} /&gt;</pre><p>Between components the rule is the same: data goes down as props, and changes come back up as callbacks. Our <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/vanillajs-react/react-js/src/components/SearchBar.tsx">weather app’s search bar</a> owns its own text, and the parent only hears about it through onSearch(city) when the user actually searches. The parent never sees the half-typed city at all.</p><h4>Where it shines</h4><ul><li><strong>One door per value.</strong> Every change goes through setEmail. Want to trim spaces, block a character or log every keystroke? Put it in that one line.</li><li><strong>Easy to trace.</strong> Search for the setter and you’ve found every place that can change the value.</li><li><strong>Nothing leaks.</strong> A child can’t edit its parent’s data. It can only ask, through a callback.</li></ul><h4>Where it costs you</h4><ul><li><strong>More typing.</strong> Every field needs a value and an onChange. A twenty-field form gets noisy fast.</li><li><strong>You build the extras yourself.</strong> Dirty checks, touched state and validation don’t come for free.</li><li><strong>Forgotten handlers.</strong> Leave out onChange and you get a read-only input plus a console warning.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xj3VyLDV2HvFvEiR.png" /></figure><h3>Migrating Two-Way → One-Way</h3><p>This is the Ember or Angular to React direction. When we ported the Ember app to React, every two-way pattern mapped to one of five one-way patterns:</p><ul><li><strong>&lt;Input @value={{this.email}}&gt;</strong>: One-way (React): value + onChange + useState; From our repo: <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/ember-js/app/components/login-form.hbs">login-form.hbs</a> → <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/components/LoginForm.tsx">LoginForm.tsx</a></li><li><strong>Input bound to a store record</strong>: One-way (React): Local <strong>draft</strong> copy, saved through a mutation; From our repo: <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/ember-js/app/components/article-form.js">article-form.js</a> → <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/components/ArticleForm.tsx">ArticleForm.tsx</a></li><li><strong>hasDirtyAttributes</strong>: One-way (React): isDirty derived from the draft vs an initial snapshot; From our repo: <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/components/ArticleForm.tsx">ArticleForm.tsx</a>, <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/components/SettingsForm.tsx">SettingsForm.tsx</a></li><li><strong>Child calls </strong><strong>args.article.set(...)</strong>: One-way (React): Callback prop (onAdd) + query cache update; From our repo: <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/ember-js/app/components/comments-section.js">comments-section.js</a> → <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/components/CommentsSection.tsx">CommentsSection.tsx</a></li><li><strong>keyup handler syncing two fields</strong>: One-way (React): Derive at submit time with parseTags(); From our repo: <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/ember-js/app/components/article-form.js">article-form.js</a> → <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/components/ArticleForm.tsx">ArticleForm.tsx</a></li></ul><p>The big one is row two. The React form copies the article into local state once, and the cached article is never touched until the server says yes:</p><pre>const initial = useRef({<br>  title: article?.title ?? &#39;&#39;,<br>  description: article?.description ?? &#39;&#39;,<br>  body: article?.body ?? &#39;&#39;,<br>  rawTagList: article?.tagList.join(&#39; &#39;) ?? &#39;&#39;,<br>});<br>const [form, setForm] = useState(initial.current);<br> <br>// one handler for every field<br>const update = (field: keyof typeof form) =&gt; (e) =&gt;<br>  setForm((f) =&gt; ({ ...f, [field]: e.target.value }));<br> <br>&lt;input value={form.title} onChange={update(&#39;title&#39;)} /&gt;</pre><p>That little update(field) helper is the trick for big forms. You get almost the same convenience as @value, but every write still goes through one setter, into one draft object, owned by one component. When the user clicks Publish, the draft goes to the server through a <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/hooks/queries.ts">useSaveArticle</a> mutation, and only then does the cache change.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hIAWFsWskTICgVmB.png" /></figure><h4>Gotchas we hit</h4><p>Two-way binding was doing a lot of quiet work for free. Once you remove it, you have to do that work yourself:</p><ol><li><strong>Dirty checks need normalized values.</strong> Typing react hooks (two spaces) and react hooks gives the same tag list. So isDirty compares parseTags(form.rawTagList), not the raw string, or the Publish button lights up for nothing.</li><li><strong>Reset the baseline after saving.</strong> <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/components/SettingsForm.tsx">SettingsForm</a> calls setInitial(form) after a successful save. Skip it and the form stays &quot;dirty&quot; forever.</li><li><strong>Ask before throwing away a draft.</strong> With a local draft, navigating away means losing it. <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/components/ArticleForm.tsx">ArticleForm</a> uses React Router’s useBlocker to confirm before you leave with unsaved changes.</li><li><strong>Keep the draft when a save fails.</strong> The <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/ember-react/react-js/src/components/CommentsSection.tsx">comment form</a> clears its textarea only after onAdd succeeds. Clear it first and a network error eats the user&#39;s comment.</li><li><strong>Update the cache yourself.</strong> Editing the store record used to update every screen automatically. Now, when you change your username, the settings form must removeQueries for the old profile and invalidateQueries so author names refresh everywhere.</li></ol><p>None of these are about markup. They’re all about <strong>when</strong> state changes and <strong>who else</strong> needs to know.</p><h3>Migrating One-Way → Two-Way</h3><p>The other direction happens too: a React app moving to Angular or Vue, or a React team tired of writing onChange forty times. This direction is easier, because you&#39;re adding convenience, not removing it. The risk is different: it&#39;s tempting to bind everything, and quietly lose the clear ownership the one-way app already had.</p><p>Our todo app shows both sides. In <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/angular-react/react-js/src/App.tsx">React</a>, each field needs state plus a handler:</p><pre>const [title, setTitle] = useState(&#39;&#39;);<br>const [type, setType] = useState&lt;TodoType&gt;(&#39;normal&#39;);<br> <br>&lt;input value={title} onChange={e =&gt; setTitle(e.target.value)} /&gt;<br>&lt;select value={type} onChange={e =&gt; setType(e.target.value as TodoType)}&gt;</pre><p>In <a href="https://github.com/cobuild-tech/migratex-examples/blob/main/angular-react/angular-js/src/app/app.component.html">Angular</a>, the same two fields are plain class properties and [(ngModel)]. The handlers disappear. But look at the todo items: the <a href="https://github.com/cobuild-tech/migratex-examples/tree/main/angular-react/angular-js/src/app/todo-item">Angular </a><a href="https://github.com/cobuild-tech/migratex-examples/tree/main/angular-react/angular-js/src/app/todo-item">TodoItem</a> still takes its data as @Input() and reports back through @Output() events like onComplete and onDelete. It never edits the list itself. That&#39;s one-way across components, kept on purpose.</p><p>The mapping we follow:</p><ul><li><strong>useState + </strong><strong>value + </strong><strong>onChange on a local field</strong>: Two-way (Angular / Vue): [(ngModel)] or v-model on a component field; Keep in mind: Safe to bind. This is exactly what two-way is good at.</li><li><strong>Draft copy + save mutation</strong>: Two-way (Angular / Vue): Keep the draft. Bind to a <strong>copy</strong>, not the cached record; Keep in mind: Binding straight to a shared object brings back the Ember article bug.</li><li><strong>Props down + callback up</strong>: Two-way (Angular / Vue): @Input() + @Output(), or Vue props + emit; Keep in mind: Use model() / defineModel only for value-like widgets (a date picker, a toggle).</li><li><strong>Logic in </strong><strong>onChange (trim, mask, uppercase)</strong>: Two-way (Angular / Vue): (ngModelChange) handler, a pipe, or a ControlValueAccessor; Keep in mind: Plain [(ngModel)] silently drops the logic.</li><li><strong>isDirty derived by hand</strong>: Two-way (Angular / Vue): form.dirty, pristine, touched; Keep in mind: Free now, but dirty means &quot;touched&quot;, not &quot;changed&quot;. Type and undo, and it stays dirty.</li><li><strong>React Hook Form / Formik</strong>: Two-way (Angular / Vue): Angular Reactive Forms; Keep in mind: Often a closer match than template-driven ngModel.</li></ul><h4>Gotchas in this direction</h4><ol><li><strong>Don’t bind to shared objects.</strong> If a service hands you an object that other screens also read, copy it first ({ ...article }) and bind to the copy. Otherwise you&#39;ve rebuilt the half-typed-title bug from the Ember app.</li><li><strong>Move </strong><strong>onChange logic somewhere real.</strong> A React handler like setTitle(e.target.value.trim()) has no place to live in [(ngModel)]=&quot;title&quot;. Split it into [ngModel] + (ngModelChange), or use a reusable directive.</li><li><strong>Side effects in handlers need a new home.</strong> If onChange also saved to localStorage or fired analytics, two-way binding won&#39;t do it for you. Use a setter, a computed/effect, or a valueChanges subscription.</li><li><strong>Don’t turn every prop into a two-way prop.</strong> Angular’s model() and Vue&#39;s defineModel make it one line to let a child write to its parent. Use it for form-like widgets, not for passing whole records around.</li><li><strong>Re-check change timing.</strong> React batches updates and re-renders. Angular runs change detection and Vue updates asynchronously. Tests that check the value right after typing may need fixture.detectChanges() or await nextTick().</li></ol><h3>So Which One Wins?</h3><p>Neither. The problem was never the convenience, it was the <strong>reach</strong>. Binding an input to a local field is fine in any framework. Binding it to a shared record is where things go wrong, whether you got there with @value or with a careless model().</p><p>So the rule we follow in both directions: <strong>two-way inside a component, one-way across components.</strong> Inside a form, use whatever makes typing easy: ngModel, v-model, an update(field) helper or React Hook Form. Across component boundaries, data goes down as props or inputs and changes come back up as callbacks or events.</p><blockquote><em>Two-way inside a component, one-way across components.</em></blockquote><p><strong>Bottom line:</strong> whichever way you’re migrating, take these habits with you:</p><ol><li><strong>Every value has one owner.</strong> If you can’t say which component owns it, you’ll find out the hard way.</li><li><strong>Edit a draft, not the source.</strong> Copy into local state, save, then update the cache. This holds in React, Angular and Vue alike.</li><li><strong>Derive, don’t sync.</strong> isDirty, tag lists, button states: compute them instead of keeping them in sync with handlers.</li><li><strong>Make side effects explicit.</strong> Whatever the old binding or the old handler did “for free”, list it and do it on purpose.</li><li><strong>Test the timing.</strong> Failed saves, navigating away mid-edit, saving twice. That’s where migrations go wrong.</li></ol><h3>Our Migration Plugins</h3><p>Spotting every binding in an app, deciding which ones become drafts and which become plain controlled inputs, and proving the forms still behave the same is slow work by hand. We’ve packaged how we do it as free, open-source plugins for Claude Code, one per starting point:</p><ul><li><a href="https://github.com/cobuild-tech/cbx-plugins/tree/main/ember-to-react"><strong>ember-to-react</strong></a>: Starts from: Ember Classic and Octane; Binding style it starts from: &lt;Input @value&gt;, bound store records, mut</li><li><a href="https://github.com/cobuild-tech/cbx-plugins/tree/main/angular-to-react"><strong>angular-to-react</strong></a>: Starts from: Angular 2+ and AngularJS 1.x; Binding style it starts from: [(ngModel)], ng-model, digest cycles</li><li><a href="https://github.com/cobuild-tech/cbx-plugins/tree/main/backbone-to-react"><strong>backbone-to-react</strong></a>: Starts from: Backbone.js, Marionette, jQuery templates; Binding style it starts from: Model change events + manual render()</li><li><a href="https://github.com/cobuild-tech/cbx-plugins/tree/main/jquery-to-react"><strong>jquery-to-react</strong></a>: Starts from: jQuery apps, plugins and jQuery UI; Binding style it starts from: .val() reads and writes by hand</li><li><a href="https://github.com/cobuild-tech/cbx-plugins/tree/main/vanillajs-to-react"><strong>vanillajs-to-react</strong></a>: Starts from: Plain HTML, CSS and JavaScript; Binding style it starts from: Direct DOM updates</li></ul><p>Each plugin comes with a migration skill, a /&lt;plugin&gt;:plan command that writes a migration plan without touching your code, a read-only inventory agent that maps the old app, a parity-reviewer agent that compares each migrated piece with its original, and a bundled Context7 server for up-to-date library docs. To install one in Claude Code:</p><pre>/plugin marketplace add cobuild-tech/cbx-plugins<br>/plugin install ember-to-react@cbx-plugins</pre><p>They also work in Cursor, in VS Code with GitHub Copilot, and in the GitHub Copilot CLI. Progress is kept in a .migration/ folder in your repo, so a migration can carry on across sessions and teammates. The source and setup steps are at <a href="https://github.com/cobuild-tech/cbx-plugins">cobuild-tech/cbx-plugins</a>, and issues are welcome.</p><h3>About MigrateX</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/0*tRwJEzxk6szv0R3_.png" /></figure><p>MigrateX is our platform and service for moving software, data and infrastructure from one technology to another. It combines automation with experienced engineers. The automation does the repetitive work quickly, and the engineers make the tricky decisions, like which state becomes a local draft and which cache entries a save has to refresh.</p><p>A MigrateX project usually runs like this:</p><ol><li><strong>Assessment.</strong> We map every binding, shared record and cross-component write in your app, so you see where the work is before anyone agrees on a timeline.</li><li><strong>Plan.</strong> With your team, we decide what moves first, what gets replaced, and what can simply be deleted.</li><li><strong>Migration, step by step.</strong> Automation handles the repetitive parts. Our engineers handle state, data flow and the code that connects old and new.</li><li><strong>Proof that it works.</strong> The same tests run against both versions. A piece only counts as moved when it passes on both.</li><li><strong>Handover.</strong> We remove the temporary code and leave your team with a codebase they understand and own.</li></ol><p>Your app keeps running and shipping features the whole time, so there’s no big launch day. The examples in this post come from our <a href="https://github.com/cobuild-tech/migratex-examples">migratex-examples</a> repo, which has each small app next to its migrated version.</p><blockquote><em>Got an app full of </em><em>ngModel or </em><em>@value bindings? Tell us a little about it through </em><a href="https://cobuildx.ai/contact"><em>Contact Us</em></a><em>, and we&#39;ll start with a free chat about where the work is likely to be.</em></blockquote><p><strong>Further reading</strong></p><ul><li>Angular. <em>Two-way binding</em>. <a href="https://angular.dev/guide/templates/two-way-binding">https://angular.dev/guide/templates/two-way-binding</a></li><li>Ember. <em>Built-in Components: Input</em>. <a href="https://guides.emberjs.com/release/components/built-in-components/">https://guides.emberjs.com/release/components/built-in-components/</a></li><li>React. <em>Sharing State Between Components</em>. <a href="https://react.dev/learn/sharing-state-between-components">https://react.dev/learn/sharing-state-between-components</a></li><li>Angular. <em>Model inputs</em>. <a href="https://angular.dev/guide/components/inputs#model-inputs">https://angular.dev/guide/components/inputs#model-inputs</a></li><li>Vue. <em>Component v-model</em>. <a href="https://vuejs.org/guide/components/v-model.html">https://vuejs.org/guide/components/v-model.html</a></li></ul><p><strong>Source code</strong></p><ul><li>CobuildX AI. <em>cbx-plugins</em>: Claude Code plugins for Backbone, Angular, Ember, jQuery and Vanilla JS to React migrations. <a href="https://github.com/cobuild-tech/cbx-plugins">https://github.com/cobuild-tech/cbx-plugins</a></li><li>CobuildX AI. <em>migratex-examples</em>: small jQuery, Backbone, Angular, Ember and Vanilla JS apps and their migrated versions. <a href="https://github.com/cobuild-tech/migratex-examples">https://github.com/cobuild-tech/migratex-examples</a></li></ul><p><em>Originally published on the </em><a href="https://cobuildx.ai/blog/one-way-two-way-binding"><em>CobuildX blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1313fd71fac" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>