开发者

.NET - ConnectionString: Internal vs External IP

开发者 https://www.devze.com 2023-04-04 05:09 出处:网络
we have our website and database migrated from different servers into one server. The SQL database and ASP.NET website was in shared hosting before, they are on different machine and have different IP

we have our website and database migrated from different servers into one server. The SQL database and ASP.NET website was in shared hosting before, they are on different machine and have different IP's. Before, in my ConnectionString, the server segment of CS is the external IP of the database server, I changed that to localhost or 127.0.0.1 since they are in the same machine. My question is, does it matter if it's external or local IP? Specifically, data transfer speed? And how do data are transferred when I use external IP - Local Machine > ISP > Local Machin开发者_运维技巧e? or Local Machine > Local Machine?


It can matter depending on what SQL db you are using.

Some don't accept calls that are not accessing them by 127.0.0.1, like PostgreSQL in default mode.

If you are accessing a db on local server you can configure it to not allow external connections and make your application more secure.

0

精彩评论

暂无评论...
验证码 换一张
取 消