Results 1 to 6 of 6

Thread: data sync between applications

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2004
    Posts
    70

    data sync between applications

    Hi guys I need some help here,

    I need my application to syncronize its data with the data of the same application running on different computer in same net. This means I don't want to use a main database but just the dataset that comes with vb.net and have it checking for changes with the rest of the computers (2 or 3) if there have been any changes.

    Is this possible? Thanks.

  2. #2
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036
    Well i simple solution would be to create a folder where your application save their datasets as .xml files. If all .xml files are identical then no update is necessary between the applications.

    Regards
    Jorge
    "The dark side clouds everything. Impossible to see the future is."

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2004
    Posts
    70
    Ok, but the thing is that the data will be changing and when it changes in any of the applications running it should tell the others, and when you turn the application on it should check for changes in the database, and all this with no main database server. Can I do this with XML?

  4. #4
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036
    Originally posted by nacho2
    Ok, but the thing is that the data will be changing and when it changes in any of the applications running it should tell the others, and when you turn the application on it should check for changes in the database, and all this with no main database server. Can I do this with XML?
    I think so this a sample dataset i saved as .xml , as you there are no reference to any database.
    VB Code:
    1. <?xml version="1.0" standalone="yes"?>
    2. <NewDataSet>
    3.   <TableName>
    4.     <Column0>1</Column0>
    5.     <Column1>2</Column1>
    6.     <Column2>3</Column2>
    7.   </TableName>
    8.   <TableName>
    9.     <Column0>a</Column0>
    10.     <Column1>b</Column1>
    11.     <Column2>c</Column2>
    12.   </TableName>
    13.   <TableName>
    14.     <Column0>cat</Column0>
    15.     <Column1>dog</Column1>
    16.     <Column2>mouse</Column2>
    17.   </TableName>
    18. </NewDataSet>

    Regards
    Jorge
    "The dark side clouds everything. Impossible to see the future is."

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 2004
    Posts
    70
    Ok this is great for storing data but what about checking the other xml databases running (running in the other computers using the same application) for changes? This is calling the other (or others) database checking if it has changed, make sure the changes are newer than the data this computer has and then change its data if the changes were newer or not do anything if they aren't. Can xml do this? Or how can I code this in vb.net?

    Hey, thanks for you help.

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,038
    I would suggest that this checking would rapidly become absurd in a direct approach. After all, once you get to some number of records (very few, really), then the number of checks would become astronomical unless they can be whittled down. Consider if there were 5 fields per record with three different storage locations. For each record, each system would have to perform 10 checks. Multiply that by the number of records, plus the extra overhead of checking for records that are in one and not another, and you quickly exceed reason.

    What you might consider is implementing another scheme to track changes. Thus, for each system, a record is kept of what changes have been made to their own dataset since the last synch. If you then periodically re-synch the data, all you would have to do is look at the change list for each system and update the records on the current system accordingly.

    Alternatively, you could have a peer-to-peer system using UDP packets to alert others of the changes (assuming all systems are always connected) as they take place, so all systems could remain synched. Of course, if you did this, you would also have to implement a return receipt so that the sending system knows that the receiving system has received the message. If the message has not been acknowledged, then it could either be re-sent, or stored in a log for future sending.

    Just a few ideas.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width