I have an SQL database and an ASP.NET website on the same machine. My question is, what is the difference between connection string that points to external IP (of the same machine) and connection string that points to localhost? Is one of them faster than the other?
1 Answer
Network traffic will not be different (neither will leave your computer) but using the localhost address is better because then you can have the DB server listen only on localhost (vs listening on the network address).
3 Comments
kazinix
So the "thing" is aware that the external IP is its own so it won't leave the computer?
kazinix
I wonder what layer is the external IP determined to be locahost, OS?
sehrope
Yes. Network stacks are not supposed to send packets out onto external interfaces if they're meant to be consumed locally.