Click here to Skip to main content
13,045,019 members (44,630 online)
Rate this:
Please Sign up or sign in to vote.
See more: , +
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 /> do i implement basic data tables that are unic?
Posted 24-Dec-12 9:59am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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!

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 24 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100