且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

共享数据库桌面/网络应用程序

更新时间:2022-12-21 17:29:29

问题可能不是它的共享;相反,它可能是数据正在经历的网络。在非常少的情况下,使用网络连接比localhost访问MySQL数据更快,所以你不能期望两者的性能相同。

The problem is probably not that it's shared; rather, it's probably the network that the data is going over. There are very few circumstances in which it's faster to use a network connection than localhost for accessing MySQL data, so you can't expect the same performance from both.

但是,您应该能够通过一个良好的网络获得一个相当快速和可靠的数据库连接。如果你正在移动大量的数据,你可能需要使用某种缓存。但如果即使在中等大小的查询也发生问题,您可能必须将此问题提交给您的托管公司进行故障排除。许多共享主机没有针对远程数据库托管进行优化(大多数网站不需要/使用/想要它),所以如果他们不能适应它,你可能需要移动到满足你的需求的主机。

However, you should be able to get a fairly fast and reliable db connection over a good network. If you're moving huge amounts of data, you may have to employ some sort of caching. But if the issues are happening even on moderately-sized queries, you may have to bring that issue to your hosting company for troubleshooting. Many shared hosts are not optimized for remote DB hosting (most sites don't need/use/want it), so if they can't accomodate it, you may have to move to a host that will meet your needs.