Master (Localhost) to Master(DigitalOcean) Replication MySQL

September 21, 2015 2k views
Apache MySQL Applications MariaDB DigitalOcean LAMP Stack VPN CentOS

Hey everyone I would like to ask if this case is possible, I wanted to setup a replication of master to master from my localhost to my VPN (DigitalOcean) MySQL. As I'm using C# application for my localhost and PHP application to my Remote host, and I wanted both Server (Local and VPN) data to sync each other. So whatever transaction (Insert, Edit, Delete) are done in localhost, are also available in my VPN and vice versa.

if Possible my Question:

1.) What OS do i need to install in my Localhost? as Im using Xampp for MySQL and windows 10 for my OS, in my localhost and Centos 7.xx.x in my VPN and MariaDB.

2.) What database would I used for this case MariaDB (MySQL) or PostgreSQL?.

I really appreciate someone who could give me some guide or links for the tutorial.

Thanks A lot

1 Answer

Once you have the networking piece out of the way and your local computer can connect to your droplet and your droplet can connect to your local server this is fairly straightforward to set up.

This guide will walk you through master-master replication setup on MySQL or MariaDB.

PostgreSQL also supports replication settings if it is a better fit for your uses.

by Jason Kurtz
This second installment of "Scaling Web Applications" will list out the steps necessary for scaling a mysql deployment over two VPS.
Have another answer? Share your knowledge.