应该将参与者/服务划分为多个项目吗? [英] Should actors/services be split into multiple projects?

查看:81
本文介绍了应该将参与者/服务划分为多个项目吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试Azure Service Fabric,并开始在同一项目中添加许多参与者和服务-这样可以吗,或者我会失去诸如故障转移,可伸缩性等任何服务结构功能?

I'm testing out Azure Service Fabric and started adding a lot of actors and services to the same project - is this okay to do or will I lose any of service fabric features as fail overs, scaleability etc?

推荐答案

我的首选显然是1个actor/1服务= 1个项目.像这样的平台的最大好处是,它使您几乎无需花钱就可以编写合适的面向微服务的应用程序,至少与在其他稍微相似的平台上进行类似的实现时所具有的实现开销相比.

My preference here is clearly 1 actor/1 service = 1 project. The big win with a platform like this is that it allows you to write proper microservice-oriented applications at close to no cost, at least compared to the implementation overhead you have when doing similar implementations on other, somewhat similar platforms.

我认为这违背了这样的体系结构来构建跨越多个问题的服务或参与者的观点. (至少对我而言)使用这些虚构的约束来迫使您将这些服务的职责范围保持尽可能小是有意义的-而是依赖/调用其他服务以提供超出职责范围的功能.您当前正在实施的项目.

I think it defies the point of an architecture like this to build services or actors that span multiple concerns. It makes sense (to me at least) to use these imaginary constraints to force you to keep the area of responsibility of these services as small as possible - and rather depend on/call other services in order to provide functionality outside of the responsibility of the project you are currently implementing.

关于扩展,即使它们是同一个项目的一部分,看来您仍然仍然可以独立地扩展您的服务/角色-至少通过查看应用程序清单格式可以暗示这一点.但是,您将无法做的是项目中服务/角色的独立更新.举个例子;如果您的项目有两个不同的参与者,并且您对其中的一个进行了更改,则您仍将需要对两个参与者进行更新,因为它们是同一代码包的一部分,并且将共享一个版本号.

In regards to scaling, it seems you'll still be able to scale your services/actors independently even though they are a part of the same project - at least that's implied by looking at the application manifest format. What you will not be able to do, though, are independent updates of services/actors within your project. As an example; if your project has two different actors, and you make a change to one of them, you will still need to deploy an update to both of them since they are part of the same code package and will share a version number.

这篇关于应该将参与者/服务划分为多个项目吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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