Azure Service Fabric可靠参与者与可靠服务 [英] Azure Service Fabric reliable actors vs reliable services

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

问题描述

我是Azure Service Fabric的新手,我遇到的最大问题是

I am new to Azure Service Fabric and the biggest questions I have are

  1. 我什么时候应该使用可靠的演员?请给我一些实际的例子.
  2. 我什么时候应该使用可靠的服务?请给我一些实际的例子.

推荐答案

看一下区别:

  • 状态类比:参与者在对象图的单个实例上工作. 服务通常具有多个呼叫者的状态.
  • 范围:演员人数众多,因此无法单独工作(更像是对象).
  • 生命周期:演员仅在使用时处于活动状态,因此 更多将适合您的可用服务器资源
  • 并发性:参与者 强制单线程访问
  • 状态:参与者只需修改 聚合,服务在集合上工作,因此经常在集合上使用事务 用于ACID行为.
  • 通讯:演员通过以下方式进行交流 平台提供的渠道.服务可能会选择其他方式.
  • 访问权限:集群外部的参与者无法从外部访问 默认.您可能需要提供访问权限的服务.
  • State analogy : Actors work on a single instance of an object graph. Services usually have state for multiple callers.
  • Scope : Actors can’t work alone, because of their size (more like objects).
  • Life-cycle : Actors are only active when used, so more will fit on your available server resources
  • Concurrency : Actors enforce single threaded access
  • State : Actors just modify the aggregate, services work on sets so often use transactions on sets for ACID behavior.
  • Communication : Actors communicate through channels provided by the platform. Services may choose otherwise.
  • Access : Actors in the cluster can’t be reached from the outside by default. You’ll probably need a Service that provides access.

使用演员的时间示例:

  • 对于您的移动应用程序的每个用户,您可以拥有一个演员.
  • 对于每个向您的应用程序发送信息的恒温器,您都可以拥有一个角色.
  • 对于您的电子商务网站的每个客户,您可以拥有一个购物篮演员.

在您可能习惯的情况下创建服务.创建可靠的服务,一次为多个用户提供服务.例如气象服务.

Create a service in the cases that you are probably used to. Create a reliable service that provides a service for multiple users at once. For example a weather service.

这篇关于Azure Service Fabric可靠参与者与可靠服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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