When should a web service not be used?

后端 未结 7 860
予麋鹿
予麋鹿 2020-11-30 22:21

Using a web service is often an excellent architectural approach. And, with the advent of WCF in .Net, it\'s getting even better.

But, in my experience, some people

7条回答
  •  爱一瞬间的悲伤
    2020-11-30 23:07

    For a small scale web app I think that using web services is often quite a good idea, you can use it to easily decouple the web server from the data tier. With the straightofrward development requirements and great tooling I don't see the problem.

    However don't use web services in the following scenarios:

    • When you must use Http as the transport and Xml serialization of your data and you need lots of different bits of data, synchronously and often. Whether REST or SOAP or WS-* you're going to suffer performance issues. The more calls you make the slower your system will be. If you want medium size chunks of data less frequently, asynchronously and you can use straight TcpIp (e.g. Wcf netTcpBinding) you'd be better off.
    • When you need to query and join data from your web service with other data sources, rather motivate for a data warehouse which can be populated with properly consolidated and rationalized data from across the enterprize

    This is my experience, hope it helps.

提交回复
热议问题