Azure的服务使用布 [英] Azure Service Fabric usage

查看:191
本文介绍了Azure的服务使用布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

服务织物在BUILD大会刚刚宣布。我正在读关于它的稀缺文档和我有一个问题。

Service Fabric was just announced at the build conference. I was reading the scarce documentation about it and I have a question.

我评估服务面料托管CRUD就像是在建于ASP.NET的WebAPI的那一刻微服务。

I'm evaluating Service Fabric for hosting CRUD like microservices that are at the moment built in ASP.NET WebApi.

时的服务向布托管小块的功能,接收数据,处理它并返回结果,而不是托管CRUD的WebAPI类型的应用程序面向?

Is Service Fabric geared towards hosting small pieces of functionality that receive data, process it and return the result, rather than hosting CRUD WebApi types of application?

推荐答案

服务织物同时启用无状态和有状态微服务的创建。

Service Fabric enables the creation of both stateless and stateful microservices.

顾名思义,通过无状态服务的一个实例维持任何状态将被如果节点出现故障丢失。一个新的,新鲜的实例,只会在集群中的其他地方纺起来。

As the name suggests, any state maintained by an an instance of a stateless service will be lost if the node goes down. A new, fresh instance will simply be spun up elsewhere in the cluster.

有状态的服务提供给持续状态,而不依赖于外部存储的能力。存储在<一个任何数据href=\"http://azure.microsoft.com/en-us/documentation/articles/service-fabric-reliable-services-reliable-collections/\"相对=nofollow>可靠地收集将跨多个节点的集群中自动复制,以确保该状态为弹性的故障。

Stateful services offer the ability to persist state without relying on an external store. Any data stored in a Reliable Collection will be automatically replicated across multiple nodes in the cluster, ensuring that the state is resilient to failures.

一个常见的​​模式是使用无状态服务为一体的面向客户的门户应用程序,然后有一个服务直接流量应用程序的分区状态的服务。这隐藏解析来自客户端的分区,让他们的目标与所有的请求一个逻辑端点的工作。

A common pattern is to use a stateless service as the client-facing gateway to the application and then have that service direct traffic to the app's partitioned stateful services. This hides the work of resolving partitions from clients, allowing them to to target one logical endpoint with all requests.

看看的<一个href=\"https://github.com/Azure-Samples/service-fabric-dotnet-getting-started/tree/master/Services/WordCount\"相对=nofollow>对于如何工作的一个例子WORDCOUNT样品。该WordCount.WebService无状态服务作为前端应用程序。它简单地解决基于传入请求的分区,然后发送它。该WordCount.Service状态服务(基于单词的第一个字母分区)立即放入一个ReliableQueue那些进入的请求,然后在后台处理它们,存储在ReliableDictionary结果

Take a look at the WordCount sample for an example of how this works. The WordCount.WebService stateless service acts as the front end to the application. It simply resolves the partition based on the incoming request and then sends it on. The WordCount.Service stateful service (partitioned based on the first letter of the word) immediately puts those incoming requests in a ReliableQueue and then processes them in the background, storing the results in a ReliableDictionary.

有关详细信息,请参阅<一个href=\"http://azure.microsoft.com/en-us/documentation/articles/service-fabric-reliable-services-introduction/\"相对=nofollow>可靠的服务概述。

For more details, see the Reliable Services Overview.

请注意:现在,揭露的WebAPI端点客户最好的方法就是自我主机的无状态服务的OWIN服务器。 ASP.NET 5个项目将很快得到支持也是如此。

Note: for now, the best way to expose WebAPI endpoints to clients is to self-host an OWIN server in the stateless service. ASP.NET 5 projects will soon be supported as well.

这篇关于Azure的服务使用布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆