简体   繁体   English

web 中的网站托管服务和本地服务器中的数据库 [暂停]

[英]Website in web hosting service and DB in local server [on hold]

I have my webapp (ASP.NET) and database (SQL SERVER) on my own server.我在自己的服务器上有我的 webapp (ASP.NET) 和数据库 (SQL SERVER)。 I plan on moving the website to a web hosting service like GoDaddy but I need to keep the database on my server.我计划将网站移动到像 GoDaddy 这样的 web 托管服务,但我需要将数据库保留在我的服务器上。 Is there a way to get a connection to my database and fetch data while my website is in the web hosting service?当我的网站在 web 托管服务中时,有没有办法连接到我的数据库并获取数据?

If you host SQL Server and open up the right ports on your firewall, this could even work, but why do you want to do that?如果您托管 SQL 服务器并在防火墙上打开正确的端口,这甚至可以工作,但您为什么要这样做? a SQL connection is not really designed to be established between differemt networks, it is going to be VERY slow. SQL 连接并不是真正设计用于在不同网络之间建立的,它会非常慢。

You are going to give yourself lots of issues to take care of, if the reason you do not want to host your database in the cloud is because you consider your data very sensitive, then you will need to encrypt the connection.如果您不想将数据库托管在云中的原因是因为您认为您的数据非常敏感,那么您将需要处理很多问题,那么您将需要加密连接。

Technically it is possible to do what you ask but is at least unusual as an approach, if you do not trust the hosting provider then change provider and keep data and web application together that simplifies lots of things, not to talk about inter data center latency issues...从技术上讲,可以按照您的要求进行操作,但至少作为一种方法是不寻常的,如果您不信任托管服务提供商,请更改提供商并将数据和 web 应用程序保存在一起,这样可以简化很多事情,更不用说数据中心间的延迟了问题...

Another way you could get what you want would be to expose from your network not SQL server for incoming SQL connections, instead, make your data available via web services ( WCF or web apis ) and web app deployed elsewhere can pull data from these services with no need to connect directly to SQL server. Another way you could get what you want would be to expose from your network not SQL server for incoming SQL connections, instead, make your data available via web services ( WCF or web apis ) and web app deployed elsewhere can pull data from these services with无需直接连接到 SQL 服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM