There will be an occasional, possibly significant, delay to look up the name. But the result will then be cached on any decent OS, so most connections won't have to wait on a DNS lookup.
Is there a substantial overhead when connect to a database by the domain name instead of the IP Address, over a local network?
Question
Is there a substantial overhead when connect to a database by the domain name instead of the IP Address, over a local network?
I have an application server that is will be connecting to a mongodb server running on a separate instance, but the same local network. Is there substantial overhead for the DNS lookup?
For example:
[ app ]
-- 1.1.1.1:27017
--> [ Mongo ]
VS
[ app ]
-- mongo.example.com:27017
--> [ Mongo ]
EDIT
Is it generally considered a best practice to use the IP Address instead of the Domain name?
More info:
- DNS provider: Cloudflare
- Hosting: Digital Ocean
- Database: MongoDB
- Database Server: Ubuntu 13.10
- App running: NodeJS
Thank you!
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow