Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
hi,
my application has two parts, a version uses in central company and a version uses in another company
every day all subcompanies should send their data for main company,and they can have reports all of them,also i have basic data tables

i need the best way for replication , i have some scenarios, but im not sure ,please help me
<br />
1. i dont know using sql replication is a good way or not<br />
<br />
2. i can create script of data and then send files<br />
<br />
3. i can create export statement in code behind


<big>Problems :</big><br />
<br />
1.speed <br />
2.how do i implement basic data tables that are unic?
Posted

1 solution

First of all, it could depend on the DBMS. You have not specified what you are using.
You wrote, that data will be uploaded from branch office to the main office. So let's suppose there is no data sent back to the branches. And even less you don't need to sync data between branch offices. Because in this later case you have to deal with a much more complicated task.

You can do all that you mentioned in your post. And I can't tell you which of them will be most suitable, since I don't see the structure of your data, nor it's size. And there can be even more possibilities you could consider.

I don't understand your question about the "unique data tables". The branches will have different database schema? If so, it involves other questions...

I would not think of the uploaded data packet as rows in a the main office database. First of all, the data sent has to be consistent on it's own. I could think about many other scenarios, but here is a really simple one (you don't have to worry about lots of things):
Make a backup of the branch office database (since it is binary, it will be probably smaller than any text representation), compress the backup. Upload the compressed file. At the main office decompress and restore every uploaded backup to a database dedicated to that branch office. There you have two options: use SELECT INTO statements to copy data from branch databases to the main one, or make your report queries to aggregate data from all branch databases.

If you choose to merge data, making the rows unique is really easy by using a primary key of two fields: the original one unique at branch level, and an id that is identifying the branch office itself. This way you can always see which data is coming from which branch office.

Good luck!
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900