1

I am trying to implement a asp.net mvc4 website. This website is supposed to built on the principles of service oriented architecture (i.e all the different modules like patients ,users will be separated as a service). This website is a plain website which calls web services which in turn talk with the CQRS layer of the service/module. I wanted to know whether this is a right architecture for a web project. My database is a multi-tenanted database. Do you think it would be better if i removed the web service layer?. Right now i have implemented the project using wcf web services and everything works fine but just wanted to have an idea if i could anything else to make the architecture better

4

2 回答 2

1

我可能会建议采取措施采用更异步的命令模型,而不是围绕阻塞请求/响应 Web 服务构建的模型(WCF 和 Web API 也是如此)。

您还可以通过基于发布/订阅事件的同步模型对某些读取模型(可能是缓存)提供良好的服务,从而提高查询的性能和简单性。

在基础设施方面,像NServiceBusMass Transit这样的服务总线可能是一个不错的选择。还有一个名为NCQRS的项目,但它似乎处于 alpha 版本(我自己没有使用过),所以我不确定是否可以推荐它用于生产用途。

于 2013-07-10T15:32:02.870 回答
0

从 Web 应用程序调用 Web 服务很好。在这种情况下最好使用 AJAX 以提高效率。现在我们有 ASP.NET Web API ( http://www.asp.net/web-api ) 来创建 Restful 服务(而不是 WCF Web 服务)。使用 ASP.NET Web API 很简单,需要较少的配置。如果可能的话,这是您现在可以考虑的两点。谢谢。

于 2013-07-09T09:43:21.613 回答