[Documentation] HanDBase Conduit - How Data is Synchronized

Discussions for the HanDBase for iPad and it's conduits and desktop add-ons

[Documentation] HanDBase Conduit - How Data is Synchronized

Postby DavidDevaneyJr » Mon Feb 23, 2015 3:14 am

I noticed that this information is currently not included in the HanDBase Conduit for iPhone/iPad/iPod Touch Quick Start Guide. This post goes into more elaborate detail on how the data in HanDBase is synchronized when using the HanDBase Conduit that's included in the HanDBase Plus/Professional/Enterprise Add-On's for iPhone/iPad/iPod Touch. This only applies to the actual HanDBase data. If you have the Professional and Enterprise Add-On please refer to the Data Exchange or Sync Exchange documentation for details on how to synchronize with other external database programs.

How Data is Synchronized
Data Changes
Generally when you change data in HanDBase on your iPhone/iPad/iPod Touch device or on the desktop/laptop the data will be synchronized and after you Synchronize the data in both places will match. Please read these other sections about How Data is Synchronized[/b] for further details and limitations. The following information gives details on how the standard Synchronization works.


Sync Level
In most circumstances HanDBase supports a Record level sync. Basically what this means is that you can edit, or add, individual records, and those changes to the individual record will appear on the other side after a synchronization. This is much better than a Database or File level sync, where the entire database is replaced by the one most recently edited each time you synchronize. Cloud based services like Google Drive and Dropbox support file level sync. With a database/file level sync you can only edit, and add, records on one platform at a time, either the iPhone/iPad/iPod Touch device or desktop/laptop.

With a Record level sync the records are never duplicated when there are conflicts. They are modified based on the following specifications.


Record Syncing
If a record is deleted in one location and modified in the other the modification will win out and after the next Synchronization the record will NOT have been deleted and the modification will be present in both locations. For example, if you delete a record on the desktop/laptop and forget you deleted it, and then modify that same record on the iPhone/iPad/iPod Touch device, after the next Synchronization the record will re-appear on the desktop/laptop with the modification.

If you edit a record on both the iPhone/iPad/iPod Touch device AND the desktop/laptop, whichever database was modified last will win out. For example if you change the last name of someone named 'Smith' to 'Smyth' on the iPhone/iPad/iPod Touch device, and then change it to 'Smythe' on the desktop/laptop, after the next Synchronization both locations will reflect the change made to the desktop because that change was made last. Note: This is dependent on the clock on your
iPhone/iPad/iPod Touch device and desktop/laptop being in Sync. If they are off then this may not work as documented.

If you edit a record on the iPhone/iPad/iPod Touch device OR the desktop/laptop, after the next Synchronization that change or addition will be reflected in both locations.

If you add a record on the iPhone/iPad/iPod Touch device OR the desktop/laptop, after the next Synchronization that change or addition will be reflected in both locations.

If you edit or add one record on the iPhone/iPad/iPod Touch device OR the desktop/laptop, and a second record in the other location after the next Synchronization both changes or additions will be reflected in both locations.


Field Type Information
Text, Integer, Float and Popup fields popup items:

If you add a popup item to the database on the iPhone/iPad/iPod Touch device OR the desktop/laptop that change will appear on both after the next Synchronization.

If you edit a popup item on the iPhone/iPad/iPod Touch device OR the desktop/laptop that change will appear on both after the next Synchronization.

If you edit the same popup value on both the iPhone/iPad/iPod Touch device AND the desktop/laptop, whichever Database was changed last will be the one that prevails. For example if you have a popup value of Smith and you change it to Smithe on the iPhone/iPad/iPod Touch device first and then change it to Smyth on the desktop/laptop when you Synchronize both will now indicate Smyth because the desktop was changed last.


Master Record Changes
The following items can be changed and the changes will be Synchronized and appear on both the iPhone/iPad/iPod Touch device and desktop/laptop after the Synchronization.

    - Sort Order
    - Field Filtering
    - Field Order
    - Database Category
    - Search String
    - Database Author/Comment
    - Adding Views

If you change any data in one the above items on the iPhone/iPad/iPod Touch device OR the desktop/laptop, the change will appear on both after the next Synchronization.

If you change any data in one the above items on both the iPhone/iPad/iPod Touch device AND the desktop/laptop, whichever set of parameters that was changed last will be the one that prevails. For example, if you change the Author name from Dave to David on the desktop/laptop and from Dave to Dave D on the iPhone/iPad/iPod Touch device, the change made on the iPhone/iPad/iPod Touch device will be on both after the next Synchronization.

If you change data in MORE than one of the above items on the iPhone/iPad/iPod Touch device AND/OR the desktop/laptop whichever was changed last will be the one that prevails. For example, if you change the Author on the iPhone/iPad/iPod Touch device, and the Sort Order on the desktop/laptop, the change to the Author name will be lost after the next Synchronization and the Sort Order change will appear on both after the next Synchronization.


Structure Changes
The design of the HanDBase Conduit is sensitive to changes to the structure of the database. Structure Changes revert the Synchronization for that database to a Database/File Level Sync for any changes made. Please see the Examples below for more details.

A change to the structure is defined as changing one of the following items in your database either on the desktop or on the iPhone/iPad/iPod Touch device:

    - Adding a new field
    - Change to a Field Type (eg Changing an Integer field to a Text field.)
    - Make an Existing Field "Not Used" (This means you essentially Delete a field, by changing it from a specific field type, eg Text, to "Not Used")

If you change any of the above items, whichever database was most recently changed will prevail. In other words the data and structure will be taken from the most recently changed database. The older or unchanged database is backed up if you have that option enabled.
[i]Note:
This is dependent on the clock on your iPhone/iPad/iPod Touch device and desktop/laptop being in Sync. If they are off then this may not work as documented.

Example 1: If you "Add" a new field on the iPhone/iPad/iPod Touch device by changing it from Not-Used and then add a record on the desktop/laptop the iPhone/iPad/iPod Touch device addition will be lost and the added record will appear on both meaning the desktop/laptop, which was changed most recently, overwriting the iPhone/iPad/iPod Touch device where a field type change was made.

Example 2: If you change a Field Type from Integer to Text on the iPhone/iPad/iPod Touch device and then add a record on the iPhone/iPad/iPod Touch device, making no changes on the desktop/laptop, the Field Type change and record addition will appear on both after the next Synchronization.

Example 3: If you add a record on the iPhone/iPad/iPod Touch device and then on your computer you change a field type from Not-Used to Float, adding a field, the Field Type change will appear on both after the next Synchronization and the record addition will be lost. [edited 3/10/15 - added on computer]

NOTE: There is a greater chance of lost data when you are changing the Structure of a database even with the HanDBase Conduit. Please be aware of these limitations and make sure that you if you make changes to the structure on one end, the iPhone/iPad/iPod Touch device, for example, DO NOT make changes to your data or add new records on the other end, the desktop/laptop in this example, if you are Changing the structure of the database. However if your data is lost it will be retained in a backup, if you have that option enabled. To avoid problems, we recommend that when you need to make changes to the structure of the database that you synchronize your iPhone/iPad/iPod Touch device with your desktop/laptop and then make the changes either on your iPhone/iPad/iPod Touch device or desktop/laptop. Then immediately synchronize your changes to avoid any data loss.
Last edited by DavidDevaneyJr on Tue Mar 10, 2015 1:58 pm, edited 1 time in total.
Regards,
David Devaney, Jr.
DavidDevaneyJr
 
Posts: 134
Joined: Tue May 19, 2009 11:01 pm
Location: Lake Worth, FL

Re: [Documentation] HanDBase Conduit - How Data is Synchroni

Postby mattz » Mon Mar 09, 2015 9:55 pm

Thanks for those examples. With your final example; (Example 3 under Structure Changes), I presume that the record addition will only be lost if the field type was changed on the desktop, and that it would appear on both desktop/laptop and portable device after Synchronization if the field type change was made on the iPhone/iPad/iPod Touch device - is that correct?
mattz
 
Posts: 1
Joined: Mon Mar 09, 2015 9:50 pm

Re: [Documentation] HanDBase Conduit - How Data is Synchroni

Postby Brian_Houghton » Tue Mar 10, 2015 5:49 am

mattz wrote:Thanks for those examples. With your final example; (Example 3 under Structure Changes), I presume that the record addition will only be lost if the field type was changed on the desktop, and that it would appear on both desktop/laptop and portable device after Synchronization if the field type change was made on the iPhone/iPad/iPod Touch device - is that correct?


Hi mattz,

Thanks for posting.

Essentially, best practice is that prior to making any structure changes, you sync so data is updated in both locations. Then make structure changes and sync again so those changes are reflected in both locations. Then go back to usage as normal.
Kind Regards,
Brian Houghton, DDH Software
Brian_Houghton
 
Posts: 2246
Joined: Wed May 20, 2009 8:30 am

Re: [Documentation] HanDBase Conduit - How Data is Synchroni

Postby DavidDevaneyJr » Tue Mar 10, 2015 1:56 pm

mattz wrote:Thanks for those examples. With your final example; (Example 3 under Structure Changes), I presume that the record addition will only be lost if the field type was changed on the desktop, and that it would appear on both desktop/laptop and portable device after Synchronization if the field type change was made on the iPhone/iPad/iPod Touch device - is that correct?


@mattz, yes you are correct. It would only be lost if the change were made on the desktop. I accidentally left that out of the example. If both changes were made on the device, it would be like Example 2 under Structure Changes and then both changes would appear on both sides.

Brian is correct though, when it comes to making Structure Changes.
Regards,
David Devaney, Jr.
DavidDevaneyJr
 
Posts: 134
Joined: Tue May 19, 2009 11:01 pm
Location: Lake Worth, FL


Return to HanDBase for iPad

Who is online

Users browsing this forum: No registered users and 1 guest

cron