何时设置 Web 服务而不是仅查询数据库

发布于 2024-08-02 18:26:09 字数 225 浏览 2 评论 0原文

我们有几个针对多个不同客户的站点,每个站点都有多个不同的数据库。

有些数据库位于客户位置,有些位于我们的网站上。

我的任务是创建一些共享点站点来显示数据库中的信息。

可以从我的共享点站点调用存储过程吗?由于数据库不适用于共享点站点,因此我觉得该站点不应该直接访问数据库,而应该通过 Web 服务获取数据。当然,如果数据暴露给另一家公司,情况也会如此,但既然我们要对这一切负责,这样可以吗?

we have several sites for several different clients, each with several different databases.

Some of the databases are at client location, some are on our site.

I have been tasked with creating a few sharepoint sites that will display information from the databases.

Is it okay to call stored procedures from my sharepoint sites? Since the database is not for the sharepoint site, I feel like that site should not have direct access to the DB and should get the data through web services. Certainly, this would be the case if the data were exposed to another company, but since we are responsible for all of it, is that okay?

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

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

发布评论

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

评论(2

别忘他 2024-08-09 18:26:09

在我看来,您只需直接访问数据库就可以避免很多麻烦,因为您可以控制两端。直接访问数据库也比在两个系统之间编写一些Web服务具有更好的性能。

如果另一个系统不是你的,我绝对希望它有一个网络服务(或 RESTful Web 服务)接口。我的理由是,在大多数软件中,Web 服务实际上是为了集成,因此对它们的更改保持在最低限度。数据库模式更改在软件产品的生命周期中相当常见,因此,如果其他人直接针对数据库构建集成,则通常不容易改进模式。

In my opinion you save yourself from lot of trouble by just going directly to the database, since you control both ends. The direct access to DB will also have better performance than writing some web services in between the two systems.

If the other system wouldn't be yours, I'd definitely hope that it had a web services (or RESTful web services) interface. My reasoning here is that in most software, web services are really actually meant for integrations and thus changes to them are kept at minimum. Database schema changes are fairly typical during the lifetime of a software product and thus it's not generally easy to evolve the schema if other people build integrations directly against the DB.

审判长 2024-08-09 18:26:09

直接查询数据库不是受支持的方案,因此您不需要这样做。

最佳实践是使用现有的 Web 服务,或实现您自己的自定义 Web 服务。

Querying the database directly is not a supported scenario, thus you shouldn't ever need to do that.

Best practice is to use the existing Web Services, or implement your own custom Web Service.

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