Xamarin.Forms: Synchronization with Azure MobileServices too slow

114 Views Asked by At

I'm trying to implement Azure MobileServices in Xamarin.Forms, following this tutorial: https://learn.microsoft.com/en-us/azure/developer/mobile-apps/azure-mobile-apps/quickstarts/xamarin-forms/offline but I noticed that synchronization is very slow. For example, I synchronized a db containing 15 tables and about 60k records, and the entire process required about 6 mins! The result changes a little if I rerun the operation on a db already synchronized. Does it possible to improve entire process? I have some doubts that the technology is already used extensively, because there is very little documentation on internet and it is often out of date. In this case, what are the alternatives?

1

There are 1 best solutions below

0
Adrian Hall On

Firstly, 60K records takes a long time to synchronize the first time. It's inevitable because of the amount of data to transfer. 6 minutes is not a surprise.

However, you should have implemented the appropriate stuff for incremental sync. That includes ensuring your model has the UpdatedAt and CreatedAt timestamps, plus a globally unique ID, and naming your query when you use PullAsync(). Something like:

await mTable.PullAsync('allItems', mTable.CreateQuery());

More information: https://azure.github.io/azure-mobile-apps/howto/client/dotnet/#syncing-an-offline-table