You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@abraunegg
Regarding the handling of remote first and local first mode, the current solution is
In Remote first mode: attempting to download everything and upload only new local items
In local first mode: attempting to upload everything locally and download only new items from OneDrive
All the actions to take can be like summarized in the following table.
If this is the case, the sequence of executing fetchOneDriveDeltaAPIResponse, scanLocalFilesystemPathForNewData, and performDatabaseConsistencyAndIntegrityCheck doesn't matter. By following the rules outlined in the table below, all items can eventually achieve the correct sync state.
But executing fetchOneDriveDeltaAPIResponse first can significantly reduce the synchronization time. By retrieving 200+ items from OneDrive in a single delta request and syncing them, the synchronized items in the database can then be leveraged by the other two functions to minimize requests to OneDrive for obtaining online state, thus reducing overall processing time.
For example, if we perform scanLocalFilesystemPathForNewData first in the current local-first mode, rule 5 dictates that the DB entry does not exist, requiring single requests for each item to bring it into sync. However, if we execute fetchOneDriveDeltaAPIResponse first, we can synchronize 200+ items at once and store them in the database. This converts the original check of rule 5 into rule 1 or 2, both of which don't require action. All rules from 2 to 10 can be consolidated into rule 0 or 1, which don't require any operation after fetchOneDriveDeltaAPIResponse and querying local items is fast and inexpensive. Only rule 11, which involves scanning for new local files to upload, requires additional requests to OneDrive.
By implementing this strategy, it can significantly reduce syncing time for the local-first mode, especially for users with large number of files. Do you think this idea is feasible?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
@abraunegg
Regarding the handling of remote first and local first mode, the current solution is
All the actions to take can be like summarized in the following table.
If this is the case, the sequence of executing
fetchOneDriveDeltaAPIResponse
,scanLocalFilesystemPathForNewData
, andperformDatabaseConsistencyAndIntegrityCheck
doesn't matter. By following the rules outlined in the table below, all items can eventually achieve the correct sync state.But executing
fetchOneDriveDeltaAPIResponse
first can significantly reduce the synchronization time. By retrieving 200+ items from OneDrive in a single delta request and syncing them, the synchronized items in the database can then be leveraged by the other two functions to minimize requests to OneDrive for obtaining online state, thus reducing overall processing time.For example, if we perform
scanLocalFilesystemPathForNewData
first in the current local-first mode, rule 5 dictates that the DB entry does not exist, requiring single requests for each item to bring it into sync. However, if we executefetchOneDriveDeltaAPIResponse
first, we can synchronize 200+ items at once and store them in the database. This converts the original check of rule 5 into rule 1 or 2, both of which don't require action. All rules from 2 to 10 can be consolidated into rule 0 or 1, which don't require any operation afterfetchOneDriveDeltaAPIResponse
and querying local items is fast and inexpensive. Only rule 11, which involves scanning for new local files to upload, requires additional requests to OneDrive.By implementing this strategy, it can significantly reduce syncing time for the local-first mode, especially for users with large number of files. Do you think this idea is feasible?
( Remote / Local )
( Remote / Local )
Local first: Upload
Local first: Upload
Local first: Delete
Local first: Upload
'-' means don't care
Beta Was this translation helpful? Give feedback.
All reactions