Outsystems offline data sync with binaries
Application Type


I'm having some difficulties regarding the offline data sync. In particular with the read-only optimized pattern provided by Outsystems. 

Our mobile application need to store binary data. For example images and documents. This is because they need to be available offline. Therefore, the data needs to be stored on the offline data model. 

For this, I've build the read-only optimized pattern that syncs all (user relevant) binary data from the server to the mobile app. However, there are some difficulties, where I might need some assistance / clarification. 

  1. The read-only optimized pattern requires the 'server' entity to have an 'IsActive' attribute. When deleting a record from the server, it means that the record is not actually deleted. Since the attribute 'IsActive' is set to 'False' so that the Offline Data Sync knows what records should be deleted on the local device. 
    1. I'm wondering if there is any other way? Since now it's never possible to really delete the records from the server database. (basically they are only set on Inactive..) Don't think this is the best way to keep the database clean.
  2. During the first sync. Litterally all data is fetched, since there is no 'LastSyncDateTime'. This causes that all binary data is fetched from the server and written to the local database. 
    1. I've experienced that during this sync (which is a-sync). That the app slows down a lot. Queries take longer to perform and so on.. Basically the mobile application gets unstable. I'm wondering if there is any way to improve this. Since it's already build according to the offline data sync documentation. 

Kind regards,

Bash Nie


Might this plugin help your case?

I'm afraid that i have to mention that its a PWA.  I believe that the plugin above cannot be used, right?

It seems that the IndexDB of the browser that is running the PWA is growing in size. Even when for example all local data is being deleted from the device (by running the 'DeleteAll<LocalEntity>' action from Outsystems). 

I've verified that the local storage is completly empty. However, the IndexDB doesn't lose it's size. In fact, when doing another sync. It seems that the IndexDB is only getting bigger and bigger. Untill it's get to big that the PWA freezes and won't launch anymore. Only way to fix it, is by clearing the browsers data.

Anyone has an idea what causes the IndexDB to grow in size even when the local storage is cleared?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.