Optimization of synchronization for slow devices

Some devices can store large volumes of information that isn't all media content or that may be inherently slow to read. To avoid an unacceptably long delay between when the device is inserted and when media playback can begin, mm-sync optimizes the synchronization of slow devices.

The overhead of database transactions makes it valuable to write information for many files (e.g., 100) in one database operation. If file information on the mediastore is slow to read, then extracting information for the number of files necessary for a full transaction can take several seconds, easily exceeding the client application's response time limits. To support faster playback, mm-sync uploads information on the first media file found, which gets marked as the first fid (or first playable file), in a dedicated transaction. This operation is known as a foreground synchronization merge.

The merge makes the first media file playable sooner and allows information for the remaining files to be synchronized later in the background, while that first file is played. When developing your client application, you can choose either to begin playback when the first fid is synchronized to the database or to wait until the files pass of synchronization completes so you have the entire list of tracks. The second strategy may be necessary if you have to play tracks in a certain order (say, alphabetically) that requires information about all files to be synchronized before playback can begin.

You can set the priority of the foreground synchronization merge with the <MergePriorityAdjust> element found in the <Configuration>/<Database>/<Synchronization> element of the configuration file.