How can Mysql database sync between two databases

0 votes

We are running a Java PoS (Point of Sale) application at various shops, with a MySql backend. I want to keep the databases in the shops synchronised with a database on a host server.

When some changes happen in a shop, they should get updated on the host server. How do I achieve this?

May 4, 2020 in Database by kartik
• 37,510 points
1,873 views

1 answer to this question.

0 votes

Hii,

Some simple rules you will have to keep in mind:

  1. Setup 1 server (master) for writing data.
  2. Setup 1 or more servers (slaves) for reading data.

This way, you will avoid errors.

For example: If your script insert into the same tables on both master and slave, you will have duplicate primary key conflict.

You can view the "slave" as a "backup" server which hold the same information as the master but cannot add data directly, only follow what the master server instructions.

NOTE: Of course you can read from the master and you can write to the slave but make sure you don't write to the same tables .

I would recommend to monitor your servers to make sure everything is fine.

Hope this is helpful!

Thank You!!

answered May 4, 2020 by Niroj
• 82,880 points

Related Questions In Database

0 votes
1 answer

How can I check my all existing table in MySQL database?

Hi Pratik, I understand your problem regarding this ...READ MORE

answered Jul 1, 2019 in Database by sampriti
• 1,120 points
1,238 views
0 votes
1 answer

How to connect to MySQL Database?

using MySql.Data; using MySql.Data.MySqlClient; namespace Data { ...READ MORE

answered Oct 12, 2018 in Database by Frankie
• 9,830 points
958 views
0 votes
1 answer

Can you please explain the difference between inner join and outer join in database?

Hi Suraj, You have a doubt regarding inner join ...READ MORE

answered May 28, 2019 in Database by sampriti
• 1,120 points
890 views
+1 vote
1 answer

How can I reset my auto_increment column in MYSQL?

Hi Pratim, I understand your issue. I think you ...READ MORE

answered Jul 2, 2019 in Database by sampriti
• 1,120 points
729 views
0 votes
1 answer

Error:Import SQL dump into PostgreSQL database

Hello, Here is the command you are looking ...READ MORE

answered May 4, 2020 in Database by Niroj
• 82,880 points
4,486 views
0 votes
1 answer
0 votes
1 answer

MySQL Error: : 'Access denied for user 'root'@'localhost'

Hello @kartik, I did this to set my ...READ MORE

answered May 4, 2020 in Database by Niroj
• 82,880 points
17,972 views
0 votes
1 answer

Error Code: 2020. Lost connection to MySQL server during query

Hello @kartik, I got the same issue when ...READ MORE

answered May 4, 2020 in Database by Niroj
• 82,880 points
2,463 views
0 votes
1 answer

How to take MySQL database backup using MySQL Workbench?

Hii, You can export like this: Hope this is ...READ MORE

answered May 4, 2020 in Database by Niroj
• 82,880 points
963 views
0 votes
1 answer

How to set SSL to Domain name for MYSQL database

Hello @ Lakshminarayanan, Yes, It is possible to setup ...READ MORE

answered Jul 9, 2020 in Database by Niroj
• 82,880 points
1,021 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP