Moving forward we will want to keep selected local Projects in sync with Access. It should be possible for a user to manage projects locally on the desktop. This can be done using the Windows File Explorer or by using the Agtek Application Framework. If using the File Explorer the changes will only be visible locally. When the user launches the Agtek Application Framework and connects with Access any local changes will be able to be synchronized with Access. The Agtek Application Framework will also have the ability to manage projects and keep things in sync with the Access server.
The synchronization algorithm that we will be using is based on an approach described in an article written by Markus Unterwaditzer, “A simple synchronization algorithm” (https://unterwaditzer.net/2016/sync-algorithm.html)
This article describes a method to keep two sets of files in sync. The main idea is that three sets are maintained. The first is the files on the Server, the second are the files on the Client and the third is a Status set which contains a map of tuples. The status map allows lookup of Hashes for the files on the Client and Server. This allows us to determine if there have been any changes to the files on either the Client or Server. The following cases determine what to do to keep things in sync:
As mentioned above, the Status set is a Map. The map key is the name of the file. The key is used to lookup a tuple which contains a Hash for the Client file and Server file. If the file being examined does not match the hash value on either the Client side or Server side then it has changed.
If there are changes to files on both the client and server then we need to prompt the user to resolve the conflict. The user can accept one change over the other or keep both changes by putting one into a new file. The results of the user decisions will be synchronized.