應用程式移轉模式和範例Application migration patterns and examples

這個「雲端採用架構」小節提供數個常見移轉案例的範例,示範如何將內部部署基礎結構移轉至 Microsoft Azure 雲端。This section of the Cloud Adoption Framework provides examples of several common migration scenarios, demonstrating how you can migrate on-premises infrastructure to the Microsoft Azure cloud.

簡介Introduction

Azure 提供全方位雲端服務組合的存取權。Azure provides access to a comprehensive set of cloud services. 讓開發人員與 IT 專業人員使用這組服務,透過全球資料中心網路在各種工具和架構上建置、部署及管理應用程式。As developers and IT professionals, you can use these services to build, deploy, and manage applications on a range of tools and frameworks, through a global network of datacenters. 當貴公司面臨與數位轉換有關的挑戰時,Azure 雲端可協助您了解如何將資源和作業最佳化、與客戶和員工交流,以及轉換您的產品。As your business faces challenges associated with the digital shift, the Azure cloud helps you to figure out how to optimize resources and operations, engage with your customers and employees, and transform your products.

不過,Azure 了解,即使雲端可在速度和彈性、降至最低的成本、效能和可靠性等方面提供優勢,但許多組織還是需要在今後的一段時間裡,執行內部部署資料中心。However, Azure recognizes that even with all the advantages that the cloud provides in terms of speed and flexibility, minimized costs, performance, and reliability, many organizations are going to need to run on-premises datacenters for some time to come. 為了回應雲端採用障礙,Azure 提供混合式雲端策略來銜接內部部署資料中心與 Azure 公用雲端。In response to cloud adoption barriers, Azure provides a hybrid cloud strategy that builds bridges between your on-premises datacenters, and the Azure public cloud. 例如,使用 Azure 備份等 Azure 雲端資源來保護內部部署資源,或使用 Azure 分析來深入了解內部部署工作負載。For example, using Azure cloud resources like Azure Backup to protect on-premises resources, or using Azure analytics to gain insights into on-premises workloads.

做為混合式雲端策略的一部分,Azure 會提供不斷增加的解決方案,協助您將內部部署應用程式和工作負載移轉至雲端。As part of the hybrid cloud strategy, Azure provides growing solutions for migrating on-premises apps and workloads to the cloud. 透過簡單的步驟,您即可全面地評估內部部署資源,以了解要如何在 Azure 雲端中執行這些資源。With simple steps, you can comprehensively assess your on-premises resources to figure out how they'll run in the Azure cloud. 然後,在有了深入評估的情況下,您可以放心地將資源遷移至 Azure。Then, with a deep assessment in hand, you can confidently migrate resources to Azure. 當資源在 Azure 中啟動並執行時,您可以將它們最佳化以維持和改善存取、彈性、安全性與可靠性。When resources are up and running in Azure, you can optimize them to retain and improve access, flexibility, security, and reliability.

移轉模式Migration patterns

移轉至雲端的策略可分成以下四大模式:重新裝載、重構、重新架構或重建。Strategies for migration to the cloud fall into four broad patterns: rehost, refactor, rearchitect, or rebuild. 您採用的策略取決於商業誘因和移轉目標。The strategy you adopt depends on your business drivers and migration goals. 您可以採用多種模式。You might adopt multiple patterns. 例如,您可以選擇重新裝載簡單的應用程式,或對您的業務不重要的應用程式,但重新架構更複雜且業務關鍵性的應用程式。For example, you could choose to rehost simple apps, or apps that aren't critical to your business, but rearchitect apps that are more complex and business-critical. 我們來看一下這些模式。Let's look at these patterns.

模式Pattern [定義]Definition 使用時機When to use
重新裝載Rehost 通常稱為隨即_轉移_。Often referred to as a lift and shift migration. 這個選項不需要變更程式碼,可讓您將現有的應用程式迅速移轉至 Azure。This option doesn't require code changes, and allows you to migrate your existing apps to Azure quickly. 每個應用程式皆依原狀移轉,可直接享有雲端優勢,而無須承擔變更程式碼的相關風險和成本。Each app is migrated as is, to reap the benefits of the cloud, without the risk and cost associated with code changes. 需要將應用程式快速移轉至雲端時。When you need to move apps quickly to the cloud.

想要在不修改應用程式的情況下進行移轉時。When you want to move an app without modifying it.

當您的應用程式經過設計,讓他們可以在遷移後利用Azure IaaS擴充性。When your apps are designed so that they can take advantage of Azure IaaS scalability after migration.

應用程式對您的業務很重要,但還不需要立即變更應用程式功能時。When apps are important to your business, but you don't need immediate changes to app capabilities.
重構Refactor 重構通常稱為「重新封裝」,需要對應用程式進行最小程度的變更,以便您連結至 Azure PaaS 並使用雲端供應項目。Often referred to as "repackaging," refactoring requires minimal changes to apps, so that they can connect to Azure PaaS, and use cloud offerings.

例如,您可將現有應用程式移轉至 Azure App Service 或 Azure Kubernetes Service (AKS)。For example, you could migrate existing apps to Azure App Service or Azure Kubernetes Service (AKS).

或者,您也可以將關聯式和非關聯式資料庫重構為 Azure SQL Database 受控執行個體、適用於 MySQL 的 Azure 資料庫、適用於 PostgreSQL 的 Azure 資料庫和 Azure Cosmos DB 之類的選項。Or, you could refactor relational and nonrelational databases into options such as Azure SQL Database Managed Instance, Azure Database for MySQL, Azure Database for PostgreSQL, and Azure Cosmos DB.
若您的應用程式可輕鬆地重新封裝以在 Azure 中運作。If your app can easily be repackaged to work in Azure.

若想採用 Azure 提供的創新式 DevOps 做法或針對工作負載使用容器策略會考慮 DevOps 時。If you want to apply innovative DevOps practices provided by Azure, or you're thinking about DevOps using a container strategy for workloads.

若要選擇重構,您必須考量現有程式碼基礎的可攜性及可用的開發技能。For refactoring, you need to think about the portability of your existing code base, and available development skills.
重新架構Rearchitect 若採用重新架構進行移轉,則會著重於修改和擴充應用程式功能及程式碼基礎,藉此將應用程式架構最佳化,以達成雲端延展性。Rearchitecting for migration focuses on modifying and extending app functionality and the code base to optimize the app architecture for cloud scalability.

例如,您可將單一應用程式劃分為數個微服務群組,如此即能輕鬆搭配運作和擴充。For example, you could break down a monolithic application into a group of microservices that work together and scale easily.

或者,您可將關聯式和非關聯式資料庫重新架構為完全受控的資料庫解決方案,例如 Azure SQL Database 受控執行個體、適用於 MySQL 的 Azure 資料庫、適用於 PostgreSQL 的 Azure 資料庫和 Azure Cosmos DB。Or, you could rearchitect relational and nonrelational databases to a fully managed database solution, such as Azure SQL Database Managed Instance, Azure Database for MySQL, Azure Database for PostgreSQL, and Azure Cosmos DB.
您的應用程式需要主要修訂,以納入新功能或在雲端平台上有效地運作時。When your apps need major revisions to incorporate new capabilities, or to work effectively on a cloud platform.

當您想要使用現有的應用程式投資、滿足擴充性需求、套用創新的 DevOps 做法,並將虛擬機器的使用降到最低。When you want to use existing application investments, meet scalability requirements, apply innovative DevOps practices, and minimize use of virtual machines.
重建Rebuild 重建的做法則更深入,您必須使用 Azure 雲端技術從頭重新打造應用程式。Rebuild takes things a step further by rebuilding an app from scratch using Azure cloud technologies.

例如,您可以使用 Azure Functions、Azure AI、Azure SQL Database 受控執行個體和 Azure Cosmos DB 等雲端原生技術來建立環保欄位應用程式。For example, you could build green-field apps with cloud-native technologies like Azure Functions, Azure AI, Azure SQL Database Managed Instance, and Azure Cosmos DB.
想要快速完成開發,且現有應用程式的功能及使用週期有限時。When you want rapid development, and existing apps have limited functionality and lifespan.

準備加速商務創新 (包括 Azure 提供的 DevOps 做法)、使用雲端原生技術建置全新應用程式,以及利用 AI、區塊鏈和 IoT 領域的先進技術時。When you're ready to expedite business innovation (including DevOps practices provided by Azure), build new applications using cloud-native technologies, and take advantage of advancements in AI, Blockchain, and IoT.

移轉範例文章Migration example articles

本節提供數個常見遷移案例的範例。This section provide examples of several common migration scenarios. 每個範例都包含背景資訊和詳細的部署案例,說明如何設定遷移基礎結構,並評估內部部署資源的適用性以進行遷移。Each example include background information and detailed deployment scenarios that illustrate how to set up a migration infrastructure and assess the suitability of on-premises resources for migration. 本節後續將新增更多文章。More articles will be added to this section over time.

一般移轉/現代化專案

一般移轉和現代化專案類別。Common migration and modernization project categories.

以下摘要說明這一系列的文章。The articles in the series are summarized below.

  • 由於每種移轉案例的商務目標都略有不同,因此移轉策略也會有所差異。Each migration scenario is driven by slightly different business goals that determine the migration strategy.
  • 針對每個部署案例,我們提供的相關資訊包括:商業誘因和目標、提議的架構、執行移轉的步驟,以及清理建議和移轉完成後可採取的後續步驟。For each deployment scenario, we provide information about business drivers and goals, a proposed architecture, steps to perform the migration, and recommendation for cleanup and next steps after migration is complete.

評量Assessment

文章Article 詳細資料Details
評估內部部署資源是否可移轉至 AzureAssess on-premises resources for migration to Azure 此計畫方法中的最佳做法文章討論如何對 VMware 上執行的內部部署應用程式進行評估。This best practice article in the Plan methodology discusses how to run an assessment of an on-premises app running on VMware. 在本文中,範例組織會使用 Azure Migrate 服務來評估應用程式虛擬機器,並使用 Data Migration Assistant 來 SQL Server 資料庫。In the article, an example organization assesses app virtual machines using the Azure Migrate service, and the app SQL Server database using Data Migration Assistant.

基礎結構Infrastructure

文章Article 詳細資料Details
部署 Azure 基礎結構Deploy Azure infrastructure 本文說明組織如何準備其內部部署基礎結構和其 Azure 基礎結構以進行移轉。This article shows how an organization can prepare its on-premises infrastructure and its Azure infrastructure for migration. 本文中建立的基礎結構範例,會供本節中提供的其他範例參考。The infrastructure example established in this article is referenced in the other samples provided in this section.

Windows Server 工作負載Windows Server workloads

文章Article 詳細資料Details
將應用程式重新裝載在 Azure VM 上Rehost an app on Azure VMs 本文提供使用 Azure Site Recovery 服務將內部部署應用程式 VM 移轉至 Azure 的範例。This article provides an example of migrating on-premises app VMs to Azure VMs using the Site Recovery service.
在 Azure 容器和 Azure SQL Database 中重新建構應用程式Rearchitect an app in Azure containers and Azure SQL Database 本文提供範例說明如何在重新建構應用程式 Web 層作為在 Azure Service Fabric 中執行的 Windows 容器,以及具有 Azure SQL Database 的資料庫時,移轉應用程式。This article provides an example of migrating an app while rearchitecting the app web tier as a Windows container running in Azure Service Fabric, and the database with Azure SQL Database.

Linux 工作負載Linux workloads

文章Article 詳細資料Details
在 Azure VM 和適用於 MySQL 的 Azure 資料庫上重新裝載 Linux 應用程式Rehost a Linux app on Azure VMs and Azure Database for MySQL 本文提供使用 Site Recovery 將 Linux 裝載的應用程式移轉至 Azure VM 的範例。This article provides an example of migrating a Linux-hosted app to Azure VMs by using Site Recovery. 它會使用 MySQL Workbench 將應用程式資料庫遷移至適用於 MySQL 的 Azure 資料庫。It migrates the app database to Azure Database for MySQL by using MySQL Workbench.
將 Linux 應用程式重新裝載至 Azure VMRehost a Linux app on Azure VMs 此範例示範如何使用 Site Recovery 服務,完成將 Linux 型應用程式隨即轉移至 Azure Vm 的操作。This example shows how to complete a lift and shift migration of a Linux-based app to Azure VMs, using the Site Recovery service.

SQL Server 工作負載SQL Server workloads

文章Article 詳細資料Details
在 Azure VM 和 SQL Database 受控執行個體上重新裝載應用程式Rehost an app on an Azure VM and SQL Database Managed Instance 本文提供適用于內部部署應用程式的隨即轉移至 Azure 的範例。This article provides an example of a lift and shift migration to Azure for an on-premises app. 這種情況包括使用Azure Site Recovery將應用程式前端 VM,以及使用Azure 資料庫移轉服務,將應用程式資料庫移轉至 Azure SQL Database 受控執行個體。This effort involves migrating the app front-end VM using Azure Site Recovery, and the app database to an Azure SQL Database Managed Instance using the Azure Database Migration Service.
在 Azure VM 上和 SQL Server Always On 可用性群組中重新裝載應用程式Rehost an app on Azure VMs and in a SQL Server Always On availability group 此範例說明如何使用 Azure 裝載的 SQL Server VM 移轉應用程式和資料。This example shows how to migrate an app and data using Azure hosted SQL Server VMs. 範例中會使用 Site Recovery 來移轉應用程式 VM,並使用 Azure 資料庫移轉服務,將應用程式資料庫移轉至受到 SQL Server 可用性群組保護的 SQL Server 叢集。It uses Site Recovery to migrate the app VMs, and the Azure Database Migration Service to migrate the app database to a SQL Server cluster that's protected by an Always On availability group.

ASP.NET、PHP 和 JAVA 應用程式ASP.NET, PHP, and Java apps

文章Article 詳細資料Details
在 Azure Web 應用程式和 Azure SQL Database 中重構應用程式Refactor an app in an Azure web app and Azure SQL Database 此範例說明如何將內部部署 Windows 型應用程式移轉至 Azure Web 應用程式,以及使用 Database Migration Assistant 將應用程式資料庫移轉至 Azure SQL Server 執行個體。This example shows how to migrate an on-premises Windows-based app to an Azure web app and migrates the app database to an Azure SQL Server instance with the Data Migration Assistant.
使用 Azure App Service、Azure 流量管理員及適用於 MySQL 的 Azure 資料庫,將 Linux 應用程式重構至多個區域Refactor a Linux app to multiple regions using Azure App Service, Azure Traffic Manager, and Azure Database for MySQL 此範例說明如何使用 Azure 流量管理員,將內部部署 Linux 型應用程式移轉至多個 Azure 區域的 Azure Web 應用程式,與 GitHub 整合以進行持續傳遞。This example shows how to migrate an on-premises Linux-based app to an Azure web app on multiple Azure regions using Azure Traffic Manager, integrated with GitHub for continuous delivery. 應用程式資料庫會移轉至適用於 MySQL 的 Azure 資料庫執行個體。The app database is migrated to an Azure Database for MySQL instance.
在 Azure 中重建應用程式Rebuild an app in Azure 本文提供的範例說明如何使用各種 Azure 功能和受控服務來重建內部部署應用程式,包括 Azure App Service、Azure Kubernetes Service (AKS)、Azure Functions、Azure 認知服務及 Azure Cosmos DB。This article provides an example of rebuilding an on-premises app using a range of Azure capabilities and managed services, including Azure App Service, Azure Kubernetes Service (AKS), Azure Functions, Azure Cognitive Services, and Azure Cosmos DB.
在 Azure DevOps Services 上重構 Team Foundation ServerRefactor Team Foundation Server on Azure DevOps Services 本文中的範例說明將內部部署 Team Foundation Server 部署移轉至 Azure 中的 Azure DevOps Services。This article shows an example migration of an on-premises Team Foundation Server deployment to Azure DevOps Services in Azure.

移轉調整Migration scaling

文章Article 詳細資料Details
對 Azure 進行大規模移轉Scale a migration to Azure 本文說明如何讓範例組織準備好對 Azure 進行完整規模的移轉。This article how an example organization prepares to scale to a full migration to Azure.

示範應用程式Demo apps

本節所提供的範例文章使用兩個示範應用程式: SmartHotel360 和 osTicket。The example articles provided in this section use two demo apps: SmartHotel360 and osTicket.

  • SmartHotel360: 此應用程式是由 Microsoft 開發做為測試應用程式,可讓您在使用 Azure 時使用。SmartHotel360: This app was developed by Microsoft as a test app that you can use when working with Azure. SmartHotel360 以開放原始碼提供,您可從 GitHub 下載;It's provided as open source and you can download it from GitHub. 其為一種連線至 SQL Server 資料庫的 ASP.NET 應用程式。It's an ASP.NET app connected to a SQL Server database. 在這些文章所討論的案例中,此應用程式的目前版本會部署到分別執行 Windows Server 2008 R2 和 SQL Server 2008 R2 的兩個 VMware VM。In the scenarios discussed in these articles, the current version of this app is deployed to two VMware VMs running Windows Server 2008 R2, and SQL Server 2008 R2. 這些應用程式 VM 裝載於內部部署,且由 vCenter Server 管理。These app VMs are hosted on-premises and managed by vCenter Server.
  • osTicket: 在 Linux 上執行的開放原始碼服務台票證應用程式。osTicket: An open-source service desk ticketing app that runs on Linux. 您可以從 GitHub 下載。You can download it from GitHub. 在這些文章所討論的案例中,此應用程式的目前版本會使用 Apache 2、PHP 7.0 和 MySQL 5.7 在內部部署到執行 Ubuntu 16.04 LTS 的兩個 VMware VMIn the scenarios discussed in these articles, the current version of this app is deployed on-premises to two VMware VMs running Ubuntu 16.04 LTS, using Apache 2, PHP 7.0, and MySQL 5.7