user586399
user586399

Reputation:

Synchornizing contents of databases

My problem: I have many branches, each having its own database. However, their databases structure is the same, only data in each branch differ. Because clients need to know data of each other, I have too a "master" or "central" database in a server, whose job is to help client databases to synchronize contents of each other, by storing all changes happening in client databases.

You may ask "why don't you have a single database in the server that client connect to it directly, rather than having duplicate copies of client databases?". The answer is, client machines have not always-available connection to the server. Because internet connection may be broken sometimes, I need to store changes locally then synchronize with server when connection is available. After that, clients connect to server to maintain the latest data.

I need some solution to track all changes happened locally. Is the above design feasible? Is there a better\easier solution? If it is suitable, how can I perform the job of synchronization?

Upvotes: 0

Views: 30

Answers (1)

Remus Rusanu
Remus Rusanu

Reputation: 294177

You need to read about SQL Server Replication. The topic is vast and you will need to spend several days reading before deciding on the proper solution. You have to decide your replication strategy (Transactional or Merge), your topology and various other replication aspects like vertical and horizontal partitioning. It may be something as simple as a publisher DB at the headquarters with merge subscribers at each branch.

Do not try to reinvent the wheel. There are many, incredibly dangerous, dragons under that bridge.

Upvotes: 1

Related Questions