Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a web server with a separate database server in this case a MongoDB, both are hosted on EC2, but when connecting my webserver to my database server is it best to use the public IP address or the private local one (10...*).

I'd like to have the best performance and security.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You want the private IP address for that. The public IP should only be used for public-facing services, and your Mongo is not such a service.

share|improve this answer
    
Are there any benifits giving it an CNAME? Like then it would be db.example.com, or is that just a waste of DNS lookups just to make my app configure easier to read too... I'm taking your answer as my solution, but I was curious if having a CNAME could make it easier if I wanted to make another server write to the DB too. –  Joseph Silvashy Nov 4 '11 at 18:17
    
It is possible to build your own private DNS on a private domain (or even something like 'internal.example.com') to make this easier too, and it should scale up well should the need arise. –  sysadmin1138 Nov 4 '11 at 18:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.