SOA 服务中的聚合模式

发布于 2024-10-06 04:01:53 字数 282 浏览 1 评论 0原文

我不确定这个词是否正确,但在我的企业中,我们有两种类型的服务:聚合服务和聚合服务。基本服务。

聚合服务通过其接口进行识别,其中输入是请求对象列表,类似地,响应是一个列表。服务应该以互斥的方式处理请求列表,即如果处理一个请求对象,则服务仍必须继续处理下一个请求对象。通常提供的原因是提高性能 - 它不是消费者在循环中调用服务,而是简单地创建 Request 对象列表并仅调用服务一次。另一个所谓的好处是您可以将不相关的请求分组到一个请求中。

有人也使用类似的聚合服务吗?如果是这样,您能否提供更多信息/或这种方法的好处。

I am not sure if it's a right word, but in my enterprise we have two types of services: aggregate service & elementary service.

Aggregate service are identified from their interfaces where input is List of Request objects and similarly the Response is a list. The service is supposed to process the List of Requests in mutually exclusive manner i.e. if processing for one Request object, the service must still continue to process next Request object. The usual reason offered is improving performance - instead of consumer calling service in loop, it simply creates list of Request object and call service only once. The other so called benefit is you can group unrelated requests into one request.

Does anyone also use similar kind of aggregate services? if so, can you please provide more information/ or benefits of this approach.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

∞觅青森が 2024-10-13 04:01:53

这是服务设计中的常见做法,其想法是,每当您跨越服务边界时,您都会产生成本。请记住,SOA 是在服务之间传递消息,而不是对对象的引用,这种解耦优点的代价是跨越边界。

因此,当你确实跨越界限时,你应该尽力挤出尽可能多的东西。

在上面的场景中,出于性能原因,您似乎正在以并发方式处理项目,只需确保如果正在使用任何事务资源,则您的锁定策略符合您的并发处理方法。

这里有一些关于其他 SOA 服务设计思想的优秀资源的链接。

我建议您阅读 Thomas Erl 和 Roger Sessions 撰写的文章,这将使您牢牢掌握 SOA 的含义。

构建 SOA

SOA 设计模式

在 SOA 中实现完整性

为什么您的 SOA 应该像 VW Beetle

为您的老板解释 SOA

WCF 服务性能

This is a common practice in service design, idea is that whenever you cross a service boundary, you are inuring a cost. Remember that SOA is about passing messages between services, not references to objects, the price for this decoupled goodness is cross the boundary.

So when you do cross a boundary you should try to squeeze as much out as you can.

In the scenario above, for performance reasons it seems that you are processing items in a concurrent manner, just make sure that if any transaction resource is being used that your locking strategy is in line with your concurrent processing approach.

Here are some links to nice resources about some other SOA service design ideas.

I would suggest you read articles by Thomas Erl and Roger Sessions, this will give you a firm handle on what SOA is all about.

Building a SOA

SOA Design Pattern

Achieving integrity in a SOA

Why your SOA should be like a VW Beetle

SOA explained for your boss

WCF Service Performance

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文