直接访问数据库vs Web服务 [英] direct acces database vs web service

查看:168
本文介绍了直接访问数据库vs Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们在使用直接数据库访问或使用Web服务之间进行选择时,优点和缺点是什么?

What are the pros and the cons when we have the choice between using direct database access or using web services?

对于应该响应(<0.5秒)和对此Web服务/ DB的低调用的关键应用程序,您的选择是什么?将由另一个小组维护。)

What would be your choice for a critical application that should be responsive (<0.5 sec) and with a low call to this webservice/DB (NB: the web service will be maintained by another team).

推荐答案

任何一端的任何变化都会影响另一端。但它有简单的优点,需要一个更少的网络跳。

Direct database access couples you tightly to the schema. Any changes on either end affects the other. But it's got the virtues of being simple and requiring one less network hop.

Web服务意味着更好的抽象和松散耦合通过一个额外的间接级别。 Web服务可以充当数据的单管家。当你的应用程序只是你的应用程序时,你将直接对数据库,但如果其他应用程序出现并要求相同的数据,你会增加他们将有机会,他们将需要架构更改有一天。这些更改也会影响您的应用程序。成本更高。

A web service means better abstraction and looser coupling via one additional level of indirection. A web service can act as the single steward of the data. You'll get away with going directly against the database when it's just your app, but if other apps come along and require the same data you'll increase the chances that they'll need schema changes some day. Those changes will affect your app as well. The cost is more latency.

Web服务可以是集中授权和安全性的好地方。数据库也可以做到这一点,所以也许是一个洗。

A web service can be a good place to centralize authorization and security. A database can do this as well, so perhaps it's a wash.

这篇关于直接访问数据库vs Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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