Azure Service Fabric 概觀Overview of Azure Service Fabric

Azure Service Fabric 是一個分散式系統平台,可讓您輕鬆封裝、部署及管理可調整和可信賴的微服務與容器。Azure Service Fabric is a distributed systems platform that makes it easy to package, deploy, and manage scalable and reliable microservices and containers. Service Fabric 也解決了開發及管理雲端原生應用程式時所面臨的重大挑戰。Service Fabric also addresses the significant challenges in developing and managing cloud native applications. 開發人員與管理員能夠避免複雜的基礎結構問題,專注於實作關鍵且嚴格要求之可調整、可信賴且可管理的工作負載。Developers and administrators can avoid complex infrastructure problems and focus on implementing mission-critical, demanding workloads that are scalable, reliable, and manageable. Service Fabric 代表新一代的平台,可用於建置及管理這些在容器中執行的企業級、第一層雲端級別應用程式。Service Fabric represents the next-generation platform for building and managing these enterprise-class, tier-1, cloud-scale applications running in containers.

此短片將介紹 Service Fabric 和微服務:This short video introduces Service Fabric and microservices:

法規遵循Compliance

Azure Service Fabric 資源提供者可在所有 Azure 區域中使用,並且會符合 Azure 所具有的所有合規性憑證,這包括下列項目:SOC、ISO、PCI DSS、HIPAA 及 GDPR。Azure Service Fabric Resource Provider is available in all Azure regions and is compliant with all compliance certs that Azure has; this includes the following: SOC, ISO, PCI DSS, HIPAA, and GDPR. 請檢閱下列內容以取得合規性憑證的完整清單:合規性供應項目Please review the following for a complete list of compliance certs: Compliance Offerings

由微服務組成的應用程式Applications composed of microservices

Service Fabric 可讓您建置和管理由各種微服務所組成、可調整且可靠的應用程式。Service Fabric enables you to build and manage scalable and reliable applications composed of microservices. 這些分散式微服務會在電腦共用集區 (稱為叢集) 上以高密度方式執行。These distributed microservices run at high density on a shared pool of machines, which is referred to as a cluster. Service Fabric 提供精密、輕量的執行階段,可支援無狀態和具狀態的微服務。Service Fabric provides a sophisticated, lightweight runtime that supports stateless and stateful microservices. 還提供完整的應用程式管理功能,以佈建、部署、監視、升級/修補及刪除已部署的應用程式。It also provides comprehensive application management capabilities to provision, deploy, monitor, upgrade/patch, and delete deployed applications.

Service Fabric 是針對建立雲端原生服務量身打造而成,此類服務可視需要以小規模開始,接著擴充為包含成千上萬個機器的大規模服務。Service Fabric is tailored to create cloud native services that can start small, as needed, and grow to massive scale with hundreds or thousands of machines. 現今的網際網路級別服務是使用微服務建立。Today's Internet-scale services are built of microservices. 微服務範例包括通訊協定閘道器、使用者設定檔、購物車、清查處理、佇列和快取。Examples of microservices include protocol gateways, user profiles, shopping carts, inventory processing, queues, and caches.

Service Fabric 提供技術支援給現今許多 Microsoft 服務,包括 Azure SQL Database、Azure Cosmos DB、Cortana、Microsoft Power BI、Microsoft Intune、「Azure 事件中樞」、「Azure IoT 中樞」、Dynamics 365、「商務用 Skype」以及許多核心 Azure 服務。Service Fabric powers many Microsoft services today, including Azure SQL Database, Azure Cosmos DB, Cortana, Microsoft Power BI, Microsoft Intune, Azure Event Hubs, Azure IoT Hub, Dynamics 365, Skype for Business, and many core Azure services.

Service Fabric 會將微服務裝載在容器中,這些容器部署在整個 Service Fabric 叢集之中並已啟動。Service Fabric hosts microservices inside containers that are deployed and activated across the Service Fabric cluster. 從虛擬機器改成用容器,可讓密度極為大幅地增加。A move from virtual machines to containers makes possible an order-of-magnitude increase in density. 同樣地,當您從容器移至這些容器中的微服務時,也可讓密度再提升一個量級。Similarly, another order of magnitude in density becomes possible when you move from containers to microservices in these containers. 例如,單一 Azure SQL Database 叢集是由數百個機器所組成,這些機器執行數萬個容器,而容器總共裝載了數十萬個資料庫。For example, a single cluster for Azure SQL Database comprises hundreds of machines running tens of thousands of containers that host a total of hundreds of thousands of databases. 每個資料庫都是 Service Fabric 的可設定狀態微服務。Each database is a Service Fabric stateful microservice.

如需有關微服務方法的詳細資訊,請閱讀 為何要用微服務方式建置應用程式?For more on the microservices approach, read Why a microservices approach to building applications?

容器部署和協調流程Container deployment and orchestration

Service Fabric 是將微服務部署至整個機器叢集的 Microsoft 容器協調者Service Fabric is Microsoft's container orchestrator deploying microservices across a cluster of machines. 微服務的開發方式有許多種,從使用 Service Fabric 程式設計模型ASP.NET Core,到部署您選擇的任何程式碼,應有盡有。Microservices can be developed in many ways from using the Service Fabric programming models, ASP.NET Core, to deploying any code of your choice. 重要的是,您可以在相同應用程式中同時混合容器中的服務和處理序中的服務。Importantly, you can mix both services in processes and services in containers in the same application. 如果您只是想要部署和管理容器,則 Service Fabric 作為容器協調者是一個最佳選擇。If you just want to deploy and manage containers, Service Fabric is a perfect choice as a container orchestrator.

任何 OS、任何雲端Any OS, any cloud

Service Fabric 可在任何環境執行。Service Fabric runs everywhere. 您可以在許多環境 (包括 Azure 或內部部署、Windows Server 上或 Linux 上) 建立 Service Fabric 的叢集。You can create clusters for Service Fabric in many environments, including Azure or on premises, on Windows Server, or on Linux. 您甚至可以在其他公用雲端上建立叢集。You can even create clusters on other public clouds. 此外,SDK 中的開發環境與生產環境「完全相同」 ,不涉及任何模擬器。In addition, the development environment in the SDK is identical to the production environment, with no emulators involved. 換句話說,在本機開發叢集上執行的項目,也會部署到其他環境中的叢集。In other words, what runs on your local development cluster deploys to the clusters in other environments.

Service Fabric 平台

對於 Windows 開發,Service Fabric.NET SDK 與 Visual Studio 和 Powershell 整合。For Windows development, the Service Fabric .NET SDK is integrated with Visual Studio and Powershell. 請參閱在 Windows 上準備您的開發環境See Prepare your development environment on Windows. 對於 Linux 開發,Service Fabric Java SDK 與 Eclipse 整合,Yeoman 用於為 Java、.NET Core 和容器應用程式產生範本。For Linux development, the Service Fabric Java SDK is integrated with Eclipse, and Yeoman is used to generate templates for Java, .NET Core, and container applications. 請參閱在 Linux 上準備您的開發環境See Prepare your development environment on Linux

如需建立叢集的詳細資訊,請參閱在 Windows Server 或 Linux 上建立叢集,或是透過 Azure 入口網站針對 Azure 建立叢集。For more information on creating clusters, read creating a cluster on Windows Server or Linux or for Azure creating a cluster via the Azure portal.

Service Fabric 的無狀態與具狀態微服務Stateless and stateful microservices for Service Fabric

Service Fabric 可讓您建置由微服務或容器組成的應用程式。Service Fabric enables you to build applications that consist of microservices or containers. 無狀態微服務 (如通訊協定閘道器、Web Proxy) 不會維護要求之外的可變動狀態及來自服務的回應。Stateless microservices (such as protocol gateways and web proxies) do not maintain a mutable state outside a request and its response from the service. Azure 雲端服務背景工作角色即為無狀態服務的範例。Azure Cloud Services worker roles are an example of a stateless service. 可設定狀態的微服務 (如使用者帳戶、資料庫、裝置、購物車、佇列) 會維護要求及其回應外的可變動授權狀態。Stateful microservices (such as user accounts, databases, devices, shopping carts, and queues) maintain a mutable, authoritative state beyond the request and its response. 現今的網際網路級別應用程式包含無狀態與可設定狀態微服務的組合。Today's Internet-scale applications consist of a combination of stateless and stateful microservices.

Service Fabric 的主要區別在於它強烈著重在建置具狀態服務,不論是使用內建的程式設計模型,還是使用容器化具狀態服務來建置。A key differentiation with Service Fabric is its strong focus on building stateful services, either with the built-in programming models or with containerized stateful services. 應用程式案例說明使用具狀態服務的案例。The application scenarios describe the scenarios where stateful services are used.

應用程式生命週期管理Application lifecycle management

Service Fabric 可支援雲端應用程式 (包括容器) 的完整應用程式生命週期和 CI/CD。Service Fabric provides support for the full application lifecycle and CI/CD of cloud applications including containers. 此生命週期包括開發到部署、每日管理、維護,到最終的解除委任。This lifecycle includes development through deployment, daily management, and maintenance to eventual decommissioning.

Service Fabric 應用程式生命週期管理讓應用程式管理員和 IT 操作員能夠使用簡單、低接觸的工作流程來佈建、部署、修補與監視應用程式。Service Fabric application lifecycle management capabilities enable application administrators and IT operators to use simple, low-touch workflows to provision, deploy, patch, and monitor applications. 這些內建的工作流程能大幅降低 IT 操作員的負擔,讓應用程式持續可用。These built-in workflows greatly reduce the burden on IT operators to keep applications continuously available.

大多數應用程式都是由無狀態和具狀態微服務、容器及其他一起部署之可執行檔的組合所構成。Most applications consist of a combination of stateless and stateful microservices, containers, and other executables that are deployed together. Service Fabric 在應用程式擁有強式型別,因此能夠部署多個應用程式執行個體。By having strong types on the applications, Service Fabric enables the deployment of multiple application instances. 每個執行個體都能獨立管理與升級。Each instance is managed and upgraded independently. 重要的是,Service Fabric 可以部署容器或任何可執行檔,並讓它們都變得可靠。Importantly, Service Fabric can deploy containers or any executables and make them reliable. 例如,Service Fabric 可以部署 .NET、ASP.NET Core、Python、Node.js、Windows 容器、Linux 容器、Java 虛擬機器、指令碼、Angular 或實際上任何構成您應用程式的項目。For example, Service Fabric can deploy .NET, ASP.NET Core, Python, Node.js, Windows containers, Linux containers, Java virtual machines, scripts, Angular, or literally anything that makes up your application.

Service Fabric 已與 CI/CD 工具 (例如 Azure PipelinesJenkinsOctopus Deploy) 整合,並且可與任何其他常用的 CI/CD 工具搭配使用。Service Fabric is integrated with CI/CD tools such as Azure Pipelines, Jenkins, and Octopus Deploy and can be used with any other popular CI/CD tool.

如需應用程式生命週期管理的詳細資訊,請參閱應用程式生命週期For more information about application lifecycle management, read Application lifecycle. 如需有關如何部署任何程式碼的詳細資訊,請參閱部署可體可執行檔For more about how to deploy any code, see deploy a guest executable.

主要功能Key capabilities

藉由使用 Service Fabric,您可以:By using Service Fabric, you can:

  • 部署至 Azure,或部署至執行 Windows 或 Linux 的內部部署資料中心,且程式碼零變更。Deploy to Azure or to on-premises datacenters that run Windows or Linux with zero code changes. 只要撰寫一次,就能夠在任何地方部署至任何 Service Fabric 叢集。Write once, and then deploy anywhere to any Service Fabric cluster.
  • 使用 Service Fabric 程式設計模型、容器或任何程式碼,來開發由微服務所組成的可調整應用程式。Develop scalable applications that are composed of microservices by using the Service Fabric programming models, containers, or any code.
  • 開發高度可靠的無狀態與可設定狀態微服務。Develop highly reliable stateless and stateful microservices. 使用具狀態微服務來簡化應用程式的設計。Simplify the design of your application by using stateful microservices.
  • 使用新奇的 Reliable Actors 程式設計模型,來建立具有獨立性程式碼與狀態的雲端物件。Use the novel Reliable Actors programming model to create cloud objects with self contained code and state.
  • 部署並協調包含 Windows 容器和 Linux 容器的容器。Deploy and orchestrate containers that include Windows containers and Linux containers. Service Fabric 是一個資料感知、具狀態的容器協調者。Service Fabric is a data aware, stateful, container orchestrator.
  • 以每部機器上數百或數千個應用程式或容器的高密度方式,快速部署應用程式。Deploy applications in seconds, at high density with hundreds or thousands of applications or containers per machine.
  • 並列部署相同應用程式的不同版本,並獨立升級每個應用程式。Deploy different versions of the same application side by side, and upgrade each application independently.
  • 無須停機即可管理應用程式的生命週期,包括重大升級與非重大升級。Manage the lifecycle of your applications without any downtime, including breaking and nonbreaking upgrades.
  • 擴增或縮減叢集中的節點數目。Scale out or scale in the number of nodes in a cluster. 隨著您調整節點,應用程式也會自動調整。As you scale nodes, your applications automatically scale.
  • 監視和診斷應用程式的健全狀況,並設定用來執行自動修復的原則。Monitor and diagnose the health of your applications and set policies for performing automatic repairs.
  • 監看資源平衡器協調整個叢集的應用程式重新分配。Watch the resource balancer orchestrate the redistribution of applications across the cluster. Service Fabric 會從失敗中復原,並會根據可用資源將負載分佈最佳化。Service Fabric recovers from failures and optimizes the distribution of load based on available resources.

後續步驟Next steps