Follow

My DB synchronization is slow. What should I do?

If the synchronization of the database is taking longer than you'd expect it, you can take a look at these tips and useful notes to make sure the database is in an optimal state that guarantees that the sync runs as fast as possible.

  • The database is synced automatically whenever a change is detected. The initial synchronization can take a long time depending on the size of your database, but subsequent synchronizations involve only objects that changed. You can find out the size of your database and an estimated sync time under Database > Database stats.
    If possible, you should try to carry out the initial sync while you have a fast internet connection, e.g. on WiFi.
  • Objects are always synced in their entirety (with attachments), even if only one field on it was updated.
    Try to keep the fast-changing data separate from the static data (e.g. in it's own class), to make sure that non-updated information doesn't need to be synced.
  • If you make a lot of changes to your objects, you should try to use batch operations where possible, e.g. if you make updates through the REST API.
  • If you store a lot of attachments in your database, you might profit from optimizing them or if that's not a possibility, storing them externally and adding a link to them as a field on the objects.
  • All classes are synced (that have their sync direction set to Bidirectional or Cloud to mobile only), not just the ones your activities use, so make sure that there are no unneeded classes in your database.
  • Changing the sync direction for certain classes can also make the synchronization faster in some cases, by setting the direction to Mobile to cloud only for classes that are not used on the mobile devices to read data out from. This is especially useful for e.g. classes that include log data or other gathered data from the devices that is not needed on them afterwards.
  • If you store a lot of attachments in your database, you might profit from optimizing them or if that's not a possibility, storing them externally and adding a link to them as a field on the objects.
  • Deleted objects still retain the information of the operation in the database, to make sure that there are no sync conflicts and that the operation is properly synced to the mobile devices.
    A cleanup option becomes available if the size of these objects becomes too big in relation to the whole database.
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request