Hi,
I have an application that is developed with offline support, which means that all information is temporarily stored in runtime classes on the user’s device. The data is only sent to the server when the user actively chooses to submit the report and has sufficient internet connection.
When submitting data to the server, the runtime classes are persisted, but only if their Object State is marked as either “New” or “Updated”.
Regarding data deletion, the application follows a different process. When a user deletes rows while offline, these are not immediately deleted from the server due to lack of internet connection. Instead, they are stored in separate runtime classes called “Deleted items”. This is done to handle the deletions when the internet connection is restored.
When the internet connection is restored and data needs to be synchronized, the system runs a “Delete filtered selection” against data connectors where the ID in the data connector exists in the class holding the deleted rows. The system identifies which elements to delete by looking at the IDs stored in the “Deleted items” classes. To perform these deletions, “All Objects” is activated on the data connector to access any rows that need to be deleted.
Data connectors are used because they have no performance impact, as they do not hold data and are never “re-evaluated and calculated”, but my question is whether this method of deletion is time and resource-intensive.
Does it matter that “All Objects” is activated for the Data connector regarding this way of deletion? Will “Delete filtered selection” through a data connector potentially be a bottleneck if it has to “iterate” through houndreds of thousands of rows on the server to determine which elements should be deleted? Would it be more efficient to delete individual elements directly by iterating over them and using “Delete Object” where ID equals? Alternatively, modify the data connector to filter on IDs found in the runtime class “Deleted items” to limit data access.
Another approach would be to use an async service to perform the deletion, while the application just registers the elements as “Ready for deletion”, but first, I want to get clarity on the resource usage in the issue described above.
Best regards,
Sondre