fabriciofreitag
fabriciofreitag

Reputation: 2883

.NET Application Mysql remote databases sync

We've been developing a .NET desktop application that will be integrated with a website, both using MySQL. Each software's customer will have a website. We need to sync the customer's database with a correspondent database running in our server. We'll have one database running in our server per customer. These information will be displayed in customer's website.

The sync must be made in short periods. We don't want to have an outdated website.

We've thought to write code to make this sync. It seems to be a hard task to achieve a solid sync. Customer's database will be large, it seems to be impracticable to send in short periods of time.

Then we've found database replication. Great! A smooth way to sync the database. We don't need to hard code this solution! Our customers' database would be the master and our server's ones would be the slaves. We need multiple slaves in the same MySQL server. MySQL doesn't allow it.

We could run multiple MySQL instances, a instance per customer. But we need to open a port per instance, and it sounds insecure.

Finally, we thought to open the ports and deny non-customer access with a firewall.

How would you solve this problem? We would like to listen your opinion. Thanks.

Upvotes: 0

Views: 411

Answers (2)

Void
Void

Reputation: 265

I have thought about this a little in the past.

I think that the best option would be one that avoided duplicating too many data stores by supplying the data on the web directly from the client database.

The best way I can think of doing this without opening ports etc is to use long polling or html 5 sockets to provide only requested data. This would provide a fair solution as long as your users do not expect to view all the data often.

Upvotes: 0

Jonah Kunz
Jonah Kunz

Reputation: 670

I have a similar program, I am using a CQL CE database/MS SQL. What I do is on the master server, each of the tables that I need to send updates to the client databases I put an update date field. The client databases will have a table that holds a date that thier database has been updated last. So when something changes on the server the update date gets put to the current date, then the client program will check the last update date against a web service to see if it needs to do any updates.

Upvotes: 1

Related Questions