Web Service或WebServices [英] Web Service or WebServices

查看:53
本文介绍了Web Service或WebServices的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个应用程序,该应用程序将与将安装WCF Web服务的单个服务器通信.对于这个过程,我有点陌生,想知道从长远来看,这两个选项中哪个更好,可以处理大量用户的负载:

I am in the process of creating an application which will communicate with a single server where WCF Web Service(s) would be installed. I am a little new to this process and was wondering which of these two options would be better in the long run to handle the load for a significant amount of users:

1-在多核服务器上创建并安装一个Web服务,以供所有客户端应用程序进行通信.

1- Create and install a single Web Service on a multi-core server for all of the client applications to communicate with.

2-在多核服务器上创建并安装多个Web服务,每个Web服务与客户端应用程序内部的不同模块进行通信.

2- Create and install multiple Web Services on a multi-core server, each to communicate with different modules inside of the client application.

总而言之,我只是想弄清楚是否在处理时间上以及有大量用户时,选项1和2之间是否存在显着差异,或者选项2是否会造成不必要的编程麻烦

All-in-all I'm just trying to figure out whether in processing time and with a large number of users whether there is a significant difference between options 1 and 2, or if option 2 would just create an unnecessary programming headache.

谢谢

帕特里克

推荐答案

拥有多个Web服务的优势在于,每个Web服务都可以在IIS中拥有自己的应用程序池(即工作进程).因此,您可以为一种Web服务回收一个应用程序池,而不会影响其他Web服务.

The advantage of having multiple web services would be that each can have their own application pool (i.e. worker process) in IIS. So you can recycle one application pool for one web service without affecting the others.

拥有单个Web服务的优势是维护可能更容易,因为代码在一个文件中,等等.当然,如果代码很多,这也会使维护变得更加困难.

The advantage of having a single web service would be potentially easier maintenance, since the code is in one file, etc. Of course, if it's a lot of code, this can make maintenance harder too.

问题是,正确的粒度级别是多少?

So the question is, what's the right level of granularity?

您可以按业务功能划分Web服务,我发现这是一个很好的方法.例如,如果您有一些处理发票的业务方法,则可以将其放入发票Web服务中.

You can split the web services up per business function, and I've found that this is a good approach. For example, if you have some business methods that deal with invoicing, you could put those into an Invoicing web service.

如果您还有其他处理运输订单的业务方法,则可以将其放入运输" Web服务中.

If you have other business methods that deal with shipping orders, you could put those into a Shipping web service.

在我看来,这会产生很好的效果,并且还可以让您利用前面讨论的应用程序池优势.

This creates a nice split, in my opinion, and also lets you leverage the application pool advantages discussed earlier.

示例 您可以使用 FedEx 看到这种拆分的真实示例.请注意他们如何通过运输,跟踪和可见性等方式拆分Web服务.

Example You can see a real world example of this type of split with FedEx. Note how they split their web services up by shipping, tracking and visibility, etc.

这篇关于Web Service或WebServices的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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