我的 winform 应用程序的 Web 服务/实体对象或数据读取器?

发布于 2024-08-05 13:19:25 字数 179 浏览 1 评论 0原文

最好使用 Web 服务从数据库中提取数据并将其加载到我的实体对象中,然后将实体对象发送到我的 winform 应用程序吗?

与直接访问数据库并将数据读取器拉回 winform 客户端,然后在客户端上加载实体相比,这是否会产生任何性能差异?一些用户将在中国访问美国的数据库。

有更好的选择吗?

谢谢

Is it best to use a webservice to pull data from a database and load it into my entity object, then send the entity objects to my winform app?

Will this make any performance difference over going direct to the database and pulling a datareader back to the winform client, then loading the entities on the client? Some of the users will be in China accessing a database in the US.

Are there better options?

Thanks

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

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

发布评论

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

评论(2

知你几分 2024-08-12 13:19:25

这是主观的,但一般来说,您会发现直接访问数据库的性能更好。然而,这对于关注点分离来说并不好。

考虑到系统的高度分布式特性,使用 Web 服务(或至少是 SOA 方法)对我来说很有意义。然而,我会采取额外的步骤,将业务逻辑放在 Web 服务层,而不仅仅是数据访问,但这在很大程度上取决于具体情况。我只是认为如果需要更改代码并重新部署到的地方越少越好,

这是否有理由必须是客户端应用程序而不是 Web 应用程序?这将使您的分布式用户保持最新状态变得更容易。

This is subjective, but in general, you will find better performance going directly to the database. That's not good for separation of concerns, however.

Given the highly distributed nature of your system, using web services (or at least an SOA approach) makes sense to me. However, I would go an extra step and have the business logic in at the web services tiers, not just data access, but again, that depends highly on the situation. I just think that the less places you have to change code and re-deploy to if coding changes are needed, the better,

Is there a reason this has to be a client app and not a web application? it would make keeping your distributed users up-to-date a bit easier.

起风了 2024-08-12 13:19:25

最好的选择可能是拥有分布式数据库和/或分布式服务器。无论你如何从中国的客户端应用程序到美国的数据库,网络都将成为一个巨大的瓶颈,性能可能会非常糟糕。如果你能在中国建立一个复制数据库,那将产生巨大的积极影响。

是否有网络服务在这里并不是一个重要因素。当然,添加 Web 服务会增加网络跃点,这会对性能产生负面影响,但正如我所说,我认为这不会成为性能瓶颈。

The best option is probably to have distributed databases and/or distributed servers. No matter how you go from a client app in China to a database in the US, the network will be a massive bottleneck and performance will likely be pretty horrible. If you can put a replicated database in China, that would make a huge positive difference.

Whether you have a webservice or not is not going to be a huge factor here. Sure, adding a webservice adds a network hop, which is going to negatively impact performance, but as I said, I don't think that will be your performance bottleneck.

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