Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET Synchronize , +
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

1. i dont know using sql replication is a good way or not
 
2. i can create script of data and then send files
 
3. i can create export statement in code behind

 
<big>Problems :</big>
 
1.speed
2.how do i implement basic data tables that are unic?
Posted 24-Dec-12 9:59am

1 solution

Rate this: bad
good
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!
  Permalink  
v3

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 509
1 Nirav Prabtani 298
2 OriginalGriff 215
3 _Amy 165
4 Abhinav S 160
0 OriginalGriff 7,715
1 Sergey Alexandrovich Kryukov 6,911
2 Maciej Los 3,954
3 Peter Leow 3,698
4 CHill60 2,742


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 24 Dec 2012
Copyright © CodeProject, 1999-2014
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