Different server but same database

What if I want to create a new server on different datacenter? How do I create different server but have same database?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Thank you for your detailed answer. But I think my question didn’t give the correct context of what I am trying to ask. What I want to do is, create two servers for the application load balancing (please correct me if its not what I have to do). How wil I manage the database across these without database integrity? How do you guyz have multiple instance and manage database? I would really appreciate if you could answer me this. Thank you!

Depends a bit on what you want to do. <br>Is the problem scaling or disaster recovery? <br>* If you just want to scale up the application and add more performance / a bit more redundancy on just the application server you are going to need a new application server and some way to load balance between different application servers (round robin dns, loadbalancer, geodns, logic in your app, etc.) <br>See or <br>You probably won’t gain much by putting the new application server in another data center (if the database server or the network connection goes down between your app server and database server, your site is down anyway). <br> <br>* If you have scaled up the application servers and need to scale up the database (mysql or postgresql) you are looking at clustering, replication, log shipping, and other heavy stuff (if you need this you probably already have 4-5 application servers already) <br>See or <br>If you are using some of the nosql databases(cassandra, mongodb, etc) this can be reasonably simple to do by “just” adding new servers. <br>If you do some of these scale ups correctly you are also going to add a bit of redundancy, if you have 3 applicationserver and a decent loadbalancer one of the application servers can crash and none of the users will notice. <br> <br>* If you want to add disaster recovery to your system you are basically going to add both app servers and database servers in another data center. You will have to deal with all the above issues (with at least 2-3 times the complexity) and also think about how to deal with different split-brain scenarios (what happens if the only thing going down is the network between the data centers, what to do if the same data is changed differently in both data centers at the same time, etc)