The Wild

4 Rs of Cloud Migration: Rehost, Refactor, Revise, Rebuild

· 7 min read · Mammals

In this article
  1. Background: Why the 4 Rs Exist
  2. The 4 Rs Explained
  3. How to Choose the Right R
  4. Common Problems and Misconceptions
  5. Costs and Timeframes
  6. Alternatives to the 4 Rs
  7. Frequently Asked Questions

The 4 Rs of cloud migration are Rehost, Refactor, Revise, and Rebuild—four common strategies for moving applications to the cloud, ranging from a simple lift-and-shift to a full rewrite. Choosing the right one depends on your business goals, the application's architecture, and how much change you can tolerate.

Background: Why the 4 Rs Exist

Before the cloud, most companies ran applications in their own data centers on physical servers. Moving to the cloud isn't just about copying files—it's about deciding how deeply to transform each application to take advantage of cloud benefits like elasticity, managed services, and pay-as-you-go pricing. The 4 Rs framework was popularized by cloud providers and consulting firms as a way to categorize the main migration paths. It helps teams avoid a one-size-fits-all approach, because what works for a simple internal tool may be terrible for a mission-critical customer-facing system.

Originally, some frameworks listed only three Rs (Rehost, Refactor, Rebuild), but over time a fourth—Revise—was added to cover partial modifications. Some vendors now use even more Rs (like Relocate or Retain), but the core four remain the most widely taught and used.

The 4 Rs Explained

Rehost (Lift-and-Shift)

Rehost means moving an application to the cloud without changing its architecture or code. You essentially take the virtual machine (VM) or server image and run it on a cloud VM. This is the fastest and least risky migration because you don't touch the application itself. It's ideal for:

  • Quick wins: moving out of a data center that's expiring a lease.
  • Applications that are hard to refactor due to legacy dependencies.
  • When you need to prove cloud value fast with minimal disruption.

Example: A company runs a legacy payroll system on a Windows Server 2008 VM. They rehost it to an AWS EC2 instance with the same OS and configuration. The app works identically, but now they pay only for what they use and can scale the VM size up or down.

Downside: You don't get most cloud advantages—no auto-scaling, no managed database, no serverless. You may also end up paying for idle capacity if you don't right-size the VM.

Refactor (Re-architect)

Refactor means modifying the application to better use cloud-native features, often by breaking it into microservices or moving to managed services like a cloud database or serverless functions. This is the most complex and time-consuming R, but it yields the biggest long-term benefits: scalability, resilience, and cost efficiency.

When to refactor:

  • You need to scale rapidly (e.g., a retail app that spikes during holidays).
  • The current architecture is brittle and hard to maintain.
  • You want to reduce operational overhead by using managed services.

Example: A monolithic e-commerce platform is refactored into separate services for product catalog, cart, and checkout, each running in containers orchestrated by Kubernetes. The database is moved to a managed cloud database with automatic backups.

Downside: High effort, high risk, and requires strong engineering skills. It can take months or years.

Revise (Modify and Migrate)

Revise is a middle ground: you make limited changes to the application—usually to the infrastructure or configuration—but not a full rewrite. This often involves changing the OS, updating libraries, or adjusting how the app connects to storage or databases so it can run on a cloud platform that doesn't support the original setup.

Common scenarios:

  • You need to move from a proprietary database to a cloud-managed one.
  • The app was built for an older OS that isn't supported in the cloud.
  • You want to containerize the app without changing its code.

Example: A Java application that runs on a physical server with a local MySQL database is revised to use Amazon RDS for MySQL, and the app's connection string is updated. The code logic stays the same, but the infrastructure is modernized.

Downside: Still requires testing and some rework, but much less than a full refactor.

Rebuild (Re-architect from Scratch)

Rebuild means discarding the existing application and writing a new one from scratch, often using cloud-native technologies like serverless functions, microservices, and managed databases. This is the most extreme option and is usually only chosen when the existing app is beyond saving or no longer meets business needs.

When to rebuild:

  • The application is obsolete and lacks features users need.
  • The codebase is so old that it's cheaper to rewrite than to maintain.
  • You want to completely change the user experience or business model.

Example: A company's 20-year-old CRM is rebuilt as a modern web app using React and AWS Lambda, with data stored in DynamoDB. The old system is decommissioned.

Downside: Highest cost and risk. You may lose historical data or require extensive user retraining.

How to Choose the Right R

There's no universal best R—it depends on your context. Use these decision factors:

  1. Business priority: If speed to cloud is critical, choose Rehost. If long-term agility is the goal, consider Refactor or Rebuild.
  2. Application age and health: Old, fragile code may be better rebuilt. Modern, well-structured code can be refactored or rehosted.
  3. Team skills: Refactoring and rebuilding require cloud-native expertise. If your team lacks that, start with Rehost and learn.
  4. Budget: Rehost is cheapest upfront; Rebuild is most expensive.
  5. Compliance and security: Some regulations may force you to keep certain data on-premises, which might rule out some Rs.

A practical approach is to start with a small pilot—choose one application, apply the most suitable R, and measure results before scaling.

Common Problems and Misconceptions

One common misconception is that Rehost is always a bad idea because it doesn't fully use the cloud. In reality, Rehost is often the first step for many enterprises; they later refactor or rebuild after they've gained confidence. Another myth is that Refactor always means microservices—it can also mean simply moving to a managed database or using auto-scaling groups.

Common problems during migration include:

  • Underestimating network latency between on-premises and cloud.
  • Ignoring data transfer costs, which can be significant.
  • Not testing for performance differences (e.g., cloud storage may have different I/O characteristics).
  • Skipping security reviews—cloud misconfigurations are a leading cause of breaches.

To avoid these, do a thorough assessment of each application's dependencies, data flows, and performance requirements before choosing an R.

Costs and Timeframes

Costs vary widely by R and by application size. Rehost is typically the cheapest in terms of engineering effort—you might spend a few days per application. Refactor can take weeks to months per application. Rebuild can take months to years and cost hundreds of thousands of dollars for complex systems.

Operational costs also differ. Rehost often leads to higher ongoing costs because you're paying for VMs that may be over-provisioned. Refactor and Rebuild can reduce costs by using serverless and managed services that scale to zero when idle. However, they require more upfront investment.

Always include a cost analysis that covers compute, storage, data transfer, and licensing. Some on-premises licenses don't transfer to the cloud, so you may need to buy new ones.

Alternatives to the 4 Rs

Some frameworks add a fifth R: Retain (or Revisit). This means keeping an application on-premises for now, either because it's too risky to move, or because it's being decommissioned soon. Retain is a legitimate strategy—not every app needs to go to the cloud.

Another alternative is Replatform, which is sometimes used interchangeably with Revise. It's a lighter version of Refactor: you change the platform (e.g., from a VM to a container) without changing the code. If you see a list of 6 Rs, it often includes Replatform and Retain.

Ultimately, the 4 Rs are a starting point, not a rigid rule. Many organizations use a mix of all four across their application portfolio.

Frequently Asked Questions

What is the difference between Rehost and Refactor?

Rehost moves the application as-is to cloud VMs, with no code changes. Refactor modifies the application to use cloud-native features like managed databases, containers, or serverless, often changing the architecture.

Is Rehost always the cheapest option?

Not necessarily. Rehost has low upfront engineering cost, but ongoing VM costs can be higher than a well-optimized refactored app. Over time, refactoring may be cheaper because you can use auto-scaling and managed services.

Can I combine multiple Rs in one migration?

Yes. Many companies rehost some applications, refactor others, and retain a few on-premises. You can even apply different Rs to different parts of the same application—for example, rehost the frontend and refactor the backend database.

How long does a typical cloud migration take?

It depends on the number of applications and the chosen Rs. A single rehost can take days; a full refactor of a complex system can take months. Enterprise-wide migrations often take years and are done in phases.

What is the biggest risk in cloud migration?

Data loss and security misconfigurations are top risks. Also, underestimating the effort required for refactoring can lead to budget overruns. Proper planning, testing, and using cloud provider tools can mitigate these.