组织大型Web API解决方案

时间:2013-02-05 12:17:24

标签: asp.net-web-api

美好的一天,

我将开始为多公司组织开发Web API解决方案。我希望能为整个组织的任何公司提供所有有用的数据。

鉴于我希望这个解决方案有很大的增长,我想确保从一开始就正确组织。

我希望按公司组织各种服务,然后再按应用或功能组织。

因此,关于URL,我应该定位如下结构:

/公司1 /应用1 / serviceOperation1

还是有一些方法来利用名称空间:

/company2.billing/serviceOperation2

是否可以在我的解决方案中为每个公司创建单独的Web API项目?这样做有什么价值吗?

希望我们不会过于主观,但我看到的示例范围较小,我真的看到我的解决方案最终暴露了许多Web API服务。

谢谢,

克里斯

1 个答案:

答案 0 :(得分:1)

在编写一行代码之前,我将研究如何保护和部署信息,版本化和公司文化。

所有公司和部门是否会共享相同的安全机制(协议,证书,模式等)?

If they are shared then there is a case for keeping them in the same solution

服务是否会导致不同的负载量并部署到具有不同修补计划的多个服务器上?

If the services are going onto different servers then they should probably be split to match

部署和后续版本控制计划是否对每个服务都是独立的,还是所有服务总是一起部署?

If they are versioned independently then you would probably split the solution accordingly

公司多久重组一次并保留其申请?

If the company is constantly restructuring without you would probably want to split the services by application. If the company is somewhat stable and focused on changing the application capabilities then you would probably want to split the services by division function (accounts, legal, human resources, etc.)

至于访问它的URL应该自然来自上面的答案。希望这会有所帮助。