12 Replies Latest reply on Jun 25, 2013 12:55 AM by isunshiny

    Data Sync question?

    tunghua

      Hi:

       

      we have offices in different locations with non stable internet connect, so we are planing to have filemaker server on each location, then write script to sync data, but there are some questions that I can not solve, please if anyone could help.

       

      say at both office A and office B, we have same data 1, 2, 3, 4, 5

       

      then office A delete data 3

       

      then office B add a new data 6

       

      at the end of the day, we get these data sets

       

      A - B

      1 - 1

      2 - 2

      - 3

      4 - 4

      5 - 5

      - 6

       

      then if I build a relation between table A and table B, how could I find 3 is delete at table A, then I will go delete it also on table B, and how can I find 6 is the new record on table B, then I will write that to table A too.

       

      Thanks a lot for solving this puzzle.

       

       

      Tunghua from Taiwan ROC.

        • 1. Re: Data Sync question?
          GaryTate

          Good luck :-)

           

          There are other, more difficult problems such as what happens if office A makes changes to record 1 and office B makes different changes to the same fiels in the same record.

           

          Can either office be classes as the main source and hence host the data?

           

          You MIGHT find it easier to grab a record from the server as its needed, work on it and then push it back. But it very much depends on what the solution involves

           

          Gary

          • 2. Re: Data Sync question?
            Stephen Huston

            And you'll need to be very cautious about assuming that 3 was deleted in one rather than that it was created in the other office.

             

            From you chaert of A-B data sets, there is no difference between 3 and 6, but one was created in one place, and other was deleted in the other place.

             

            Unless you track creation and modification meta-data very carefully, what will you do with records created, synced, and later deleted, possibly on the same day? Syncing in between creation and deletion can raise some interesting decisions when next syncing, especially on the same day.

             

            It might be better to consider flagging -- rather than deleting -- records. This allows the meta-data info to be retained at the record level, requiring only creation and flagging during syncs.

            • 3. Re: Data Sync question?
              Benjamin Fehr

              There are syncing solutions which can perform whenever you have stable internet on both sides:

              GoZync (works with FMP OR FMS as host/Master):

              http://www.seedcode.com/cp-app/ste_cat/gozync

               

              360works MirrorSync (FMS required):

              http://www.360works.com/filemaker-sync/

              • 4. Re: Data Sync question?
                tunghua

                Thanks for everyone's thought, I will try to understand these too links, see if that work for our problem.

                 

                 

                Tunghua

                • 5. Re: Data Sync question?
                  isunshiny

                  Actually, the situation you've mentioned was already considered. Just add a field that caculated by modified timestamp, or decide which office is higher level to change the records.

                   

                  Compare between two tables is more difficute than that, I think.

                   

                  Carlos

                  • 6. Re: Data Sync question?
                    isunshiny

                    Delete through relationship would be unable to use if it turns to flagging, that will make huge change to the system which is already exist.

                    • 7. Re: Data Sync question?
                      Mike_Mitchell

                      If you want to roll your own sync strategy, you might want to consider the attached document. It's written from an iOS -> FM Server perspective, but the considerations it contains for syncronization are still valid.

                       

                      Mike

                      • 8. Re: Data Sync question?
                        isunshiny

                        Thanks, that would be great help.

                        While I have the same question as tunghua which is, how can I assume 3 and 6 records from table A and B.

                        • 9. Re: Data Sync question?
                          Mike_Mitchell

                          I suggest you read through the document in its entirety to understand all that's involved in a synching process. However, the short answer is this:

                           

                          You will need to preserve a timestamp of the last time a sync was performed. Compare that timestamp to the creation timestamp of the record. If the creation timestamp of the record is later than the sync timestamp, then the record was created after the last sync and needs to be added to the other table. On the other hand, if the sync timestamp is later than the creation timestamp, it means the record was deleted and should be deleted from the other table.

                           

                          HTH

                           

                          Mike

                          • 10. Re: Data Sync question?
                            isunshiny

                            While, which I don't understand is, if a record has a sync timestamp which is later than the creation timestamp, how can I know this record should be deleted or maintained?

                             

                            THANKS.

                             

                            Carlos

                            • 11. Re: Data Sync question?
                              Mike_Mitchell

                              Back to the original scenario:

                               

                              Table A has a record.

                               

                              Table B does not have the same record.

                               

                              You have a creation timestamp for that record in Table A that is earlier than the last sync timestamp. This means that the record was created in table A, and the tables have been synchronized since then. Assuming your business rules include creating records in both tables (i.e., records created in one table are to be copied into the other when they're synchronized), when they were synced, it means the record would have been copied from table A to table B. So at the last sync, both table A and table B would have had the record.

                               

                              Therefore, since it's missing from table B, we can assume a user deleted it from table B and it should therefore be deleted from table A as well.

                               

                              However, this is all assuming the business rules include deleting records during sync. That may not be the case! You really need to read through the document to understand all the possible permutations for sync strategies.

                               

                              Mike

                              • 12. Re: Data Sync question?
                                isunshiny

                                I'll read that, thank you so much!

                                 

                                Carlos