Service Fabric 概述

作者:Mark Fussell 更新:2016/9/22
翻译:朱涛峰 2016/10/9

Service Fabric is a distributed systems platform that makes it easy to package, deploy, and manage scalable and reliable microservices. Service Fabric also addresses the significant challenges in developing and managing cloud applications. Developers and administrators can avoid solving complex infrastructure problems and focus instead on implementing mission-critical, demanding workloads knowing that they are scalable, reliable, and manageable. Service Fabric represents the next-generation middleware platform for building and managing these enterprise-class, Tier-1 cloud-scale applications.

Service Fabric是一个分布式的系统平台,可帮助人们更容易地打包、 部署、管理高伸缩性和高可靠的微服务(microservices)。同时Service Fabric还可帮助人们处理一些云应用开发和管理中遇到的重大挑战。开发人员和管理员可以不再将精力放在解决复杂的基础设施问题、要求苛刻的高负载问题,而将精力集中在处理业务领域关键问题,因为Service Fabric代表着可伸缩、高可靠和易于管理。Service Fabric是下一代中间件平台,可用于构建并管理企业级规模的、一级云规模的应用。

一、微服务组成的应用(Applications composed of microservices)

Service Fabric enables you to build and manage scalable and reliable applications composed of microservices running at very high density on a shared pool of machines (referred to as a cluster). It provides a sophisticated runtime for building distributed, scalable stateless and stateful microservices. It also provides comprehensive application management capabilities for provisioning, deploying, monitoring, upgrading/patching, and deleting deployed applications.

通过Service Fabric可以构建和管理由大量microservices 组成的高伸缩性和高可用的应用,这些应用将运行在由大量机器组成的服务器共享池(称为群集)。它可以提供原本复杂的在线的构建分布式、 高伸缩性的无状态/有状态 microservices。它还能为资源调配、 部署、 监控、 升级/打补丁等提供全面的应用管理功能,还能删除已部署应用。

Why is a microservices approach important? The two main reasons are:
1.They enable you to scale different parts of your application depending on its needs.
2.Development teams are able to be more agile in rolling out changes and thus provide features to your customers faster and more frequently.

有人会问: microservices 重要吗?有两个原因︰
1.它们能够根据需要扩展的应用的不同部分。
2.开发团队能够更加敏捷,更加适应变化,并能向客户更快、 更频繁地提交功能。

Service Fabric powers many Microsoft services today, including Azure SQL Database, Azure DocumentDB, Cortana, Power BI, Microsoft Intune, Azure Event Hubs, Azure IoT, Skype for Business, and many core Azure services.

Service Fabric支持当今许多微软服务,包括 Azure SQL 数据库,Azure DocumentDB、 柯塔娜Cortana、 Power BI、 微软 Intune,Azure 事件中心、 Azure 物联网、 Skype 商业版本,和许多核心 Azure 服务。

Service Fabric is tailored to creating “born in the cloud” services that can start small, as needed, and grow to massive scale with hundreds or thousands of machines.

Service Fabric是专为打造“诞生于云”的应用服务,可以支持应用从微小规模一直成长到数百或数千台计算机的大规模。

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 is a microservices platform that gives every microservice a unique name that can be either stateless or stateful.

当今的互联网规模的服务是由微服务构成的。例如协议网关,用户配置文件,购物车,库存处理,队列和高速缓存。Service Fabric是一种微服务平台,它赋于每个微服务一个唯一名称,无论微服务是基于无状态的、还是基于有状态的。

Service Fabric provides comprehensive runtime and lifecycle management capabilities to applications composed of these microservices. It hosts microservices inside containers deployed and activated across the Service Fabric cluster. Moving from VMs to containers makes possible an order-of-magnitude increase in density. Similarly, another order of magnitude in density becomes possible by moving from containers to microservices. For example, a single Azure SQL Database cluster comprises hundreds of machines running tens of thousands of containers hosting a total of hundreds of thousands of databases. Each database is a Service Fabric stateful microservice. The same is true of the other services previously mentioned, which is why the term "hyperscale" is used to describe Service Fabric capabilities. If containers give you high density, then microservices give you hyperscale.

Service Fabric对由微服务组成的应用提供全面的在线管理、全生命周期管理功能。它承载各类容器(containers)以部署和激活跨Service Fabric集群的微服务。如果从虚拟机进化为容器使得服务密度能数量级增加,那么,从容器进化为微服务能进一步数量级地增加可管理的服务的密度。举个例子,一个单一的Azure SQL数据库群集由数百台的服务器、数以万计的容器、数以十万计的数据库组成的,其中每个数据库都是Service Fabric上持有状态的微服务。前面提到的其他微软服务也是类似的,这就是为什么用“超大规模”一词来描述Service Fabric的容量,因为如果容器能给你高密度,那么微服务能给你超大规模。

For more on the microservices approach, readWhy a microservices approach to building applications?

欲了解更多关于微服务的方法,阅读Why a microservices approach to building applications?

二、兼容多种环境Create Service Fabric clusters anywhere

You can create Service Fabric clusters in many environments, including Azure or on premises, on Windows Server or on Linux. In addition, the development environment in the SDK is identical to the production environment with no emulators involved. In other words, if it runs on your local development cluster it deploys to the same cluster in other environments.

在许多环境中,包括 Azure 或本地,Windows 或 Linux,你都可以创建Service Fabric集群。此外,开发环境的 SDK 与生产环境的SDK是一样的(中间不需要仿真器转换)。换句话说,如果它能在本地开发环境上运行,它就能直接部署到其他环境运行。

For more information on creating clusters on-premise, readcreating a cluster on Windows Server or Linuxor for Azure creating a clustervia the Azure portal.

关于创建本地集群,阅读creating a cluster on Windows Server or Linux
关于创建Azure集群,阅读via the Azure portal.

三、支持创建无状态和有状态的微服务Stateless and stateful Service Fabric microservices

Service Fabric enables you to build applications consisting of microservices. Stateless microservices (protocol gateways, web proxies, etc.) do not maintain a mutable state outside of any given request and its response from the service. Azure Cloud Services worker roles are an example of a stateless service. Stateful microservices (user accounts, databases, devices, shopping carts, queues, etc.) 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使您能够建立一个支持微服务的应用程序。无状态微服务(协议网关,Web代理,等)不保持任何请求的响应处理期外的状态。Azure云服务工作者角色是一个无状态服务的例子。有状态微服务(用户帐户,数据库,设备,购物车,队列等)保持请求的状态。当今互联网规模的应用都包括了无状态、有状态微服务的组合。

Why have stateful microservices along with stateless ones? The two main reasons are:
1.The ability to build high-throughput, low-latency, failure-tolerant online transaction processing (OLTP) services by keeping code and data close on the same machine. Some examples are interactive storefronts, search, Internet of Things (IoT) systems, trading systems, credit card processing and fraud detection systems, and personal record management.
2.Application design simplification. Stateful microservices remove the need for additional queues and caches, traditionally required to address the availability and latency requirements of a purely stateless application. Stateful services are naturally high-availability and low-latency, reducing the number of moving parts to manage in your application as a whole.

为何要将有状态和无状态的微服务一同使用?因为
1.构建高吞吐量、 低延迟、 故障容错的联机事务处理 (OLTP) 服务的需要。通过“有状态”让同一台计算机上的代码和数据尽可能靠近,有力地保证了这些能力。一些例子:交互式店面、 搜索、 物联网 (IoT) 系统、 交易系统、 信用卡处理、欺诈检测系统、个人记录管理。
2.应用程序设计的简化。有状态的微服务不再需要额外的队列和缓存方案,这些手段是解决纯粹无状态导致用户体验问题和响应延迟问题的传统方案。减少了这些部件,作为一个整体,等于减少了管理的数量,有状态服务的应用自然是提高了可用性和降低了延迟。

For more information on application patterns with Service Fabric, readApplication scenariosandChoosing a programming model frameworkfor your service

有关使用Service Fabric应用模式的更多信息,阅读Application scenarios、Choosing a programming model framework

四、应用程序生命周期管理Application lifecycle management

Service Fabric provides first-class support for the full application lifecycle management (ALM) of cloud applications--from development through deployment, daily management, and maintenance to eventual decommissioning.

Service Fabric对云应用完整的应用程序生命周期管理 (ALM) 提供一流的支持 — — 从开发到部署、 日常管理和维护对最终退役。

The Service Fabric ALM capabilities enable application administrators/IT operators to use simple, low-touch workflows to provision, deploy, patch, and monitor applications. These built-in workflows greatly reduce the burden on IT operators to keep applications continuously available.

Service Fabric ALM功能让应用管理员/ IT 运营人员使用简单的、“较少的面对面的接触”的工作流来提供、部署、修补和监控应用程序。这些内置的工作流大大减少 IT 运营人员维护高可用应用的负担。

Most applications consist of a combination of stateless and stateful microservices and other executables/runtimes deployed together. By having strong types on the applications and packaged microservices, Service Fabric enables the deployment of multiple application instances. Each instance is managed and upgraded independently. Importantly, Service Fabric is able to deployanyexecutables or runtime and make them reliable. For example, Service Fabric deploys ASP.NET Core 1, Node.js, Java VMs, scripts, or anything else that makes up your application.

大多数应用程序是由无/有状态微服务、可执行文件/运行时,部署在一起的组合。通过强类型,Service Fabric可部署应用副本、打包微服务的副本到多个应用实例。每个实例独立管理和独立升级。更重要的是,Service Fabric可支持各种可执行文件/运行时,如ASP.NET 核心 1、 Node.js、Java Vm、脚本等,对于这些可执行文件/运行时,不仅支持部署,还提高了可靠性。

For more information on application lifecycle management, readApplication lifecycleand on deploying any code seeDeploy a guest executable

关于应用程序生命周期管理的详细信息,请阅读Application lifecycle
部署、代码请参见Deploy a guest executable

五、关键功能Key capabilities

By using Service Fabric, you can:

通过使用Service Fabric,您可以︰

1.Develop massively scalable applications that are self-healing.

1.开发具有自我恢复功能的大规模的可伸缩的应用。

2.Develop applications composed of microservices using the Service Fabric programming model. Or, simply host guest executables and other application frameworks of your choice, such as ASP.NET Core 1, or Node.js.

2.用Service Fabric编程模型可开发微服务应用,或只是简单承载客户端应用、应用程序框架,如ASP.NET Core 1、 Node.js。

3.Develop highly reliable stateless and stateful microservices.

3.开发高可靠的无/有状态微服务。

4.Simplify the design of your application by using stateful microservices in place of caches and queues.

4.通过有状态微服务(取消使用缓存和队列) 简化应用程序的设计。

5.Deploy to Azure or to on-premises clouds running Windows Server or Linux with zero code changes. Write once and then deploy anywhere to any Service Fabric cluster.

5.无需为切换 Azure 或私有云、或 Windows 或 Linux部署而写代码。写代码一次,可部署到任何Service Fabric群集。

6.Develop with a "datacenter on your machine" approach. The local development environment is the same code that runs in the Azure datacenters.

6.可用 "datacenter on your machine"方式开发。同一套代码无需变更就可运行在本地开发环境和Azure 数据中心。

7.Deploy applications in seconds.

7.在几秒钟内可完成应用部署。

8.Deploy applications at higher density than virtual machines, deploying hundreds or thousands of applications per machine.

8.能比虚拟机方式部署部署更高密度的应用,可每服务器部署数百或数以千计的应用。

9.Deploy different versions of the same application side by side, each independently upgradable.

9.可同时部署同一应用的不同版本,每个应用副本可独立升级。

10.Manage the lifecycle of your stateful applications without any downtime, including breaking and nonbreaking upgrades.

10.让你的有状态应用没有停机时间,即使中断升级或升级中。

11.Manage applications using .NET APIs, PowerShell, or REST interfaces.

11.可通过.NET API、 PowerShell、 REST接口管理应用。

12.Upgrade and patch microservices within applications independently.

12.可独立升级和修补应用内的各微服务。

13.Monitor and diagnose the health of your applications and set policies for performing automatic repairs.

13.可监视和诊断应用的健康状况,可设置策略来执行应用的自动修理。

14.Scale up or scale down your Service Fabric cluster easily, knowing that the applications scale according to available resources.

14.易于扩展或缩小Service Fabric群集,易于根据现有资源判断是否满足应用规模的增长。在根据可用的资源了解应用程序规模的情况下,轻松增加或减少 Service Fabric 群集。

15.Watch the self-healing resource balancer orchestrate the redistribution of applications across the cluster. Service Fabric recovers from failures and optimizes the distribution of load based on available resources.

15.Service Fabric能通过重新编排、分配现有可用的资源,来恢复故障节点,或进行负载优化,而且这种重新分配是跨集群进行的。这种机制就是所谓的“具有自我恢复能力的资源平衡器”。观看可自我修复的资源平衡器如何在群集间协调重新分发应用程序。Service Fabric 可从故障中恢复,并基于可用资源优化负载分布。

六、相关内容Next steps

For more information:
Why a microservices approach to building applications?
Terminology overview
Setting up your Service Fabricdevelopment environment
Choosing a programming model frameworkfor your service

1.为何要用微服务?
2.Service Fabric 术语
3.配置Service Fabric开发环境
4.为你的服务选择编程模型框架

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 213,864评论 6 494
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 91,175评论 3 387
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 159,401评论 0 349
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,170评论 1 286
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,276评论 6 385
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,364评论 1 292
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,401评论 3 412
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,179评论 0 269
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,604评论 1 306
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,902评论 2 328
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,070评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,751评论 4 337
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,380评论 3 319
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,077评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,312评论 1 267
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,924评论 2 365
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,957评论 2 351

推荐阅读更多精彩内容