The Offline OData component retrieves data from a back-end OData service when an application is online, then creates an offline store that is initialized and populated with a subset of the data.
The subset is specified with a series of OData read requests known as defining queries. Individual defining queries may include entire entity sets, or they may include a filter, which retrieves a subset of the data in the entity set.
Device users can query and manipulate (create, update or delete) the local data, then later upload the changes made locally to the back end. The Offline OData component also does the following:
- Initializes and creates the offline store.
- Uploads pending modification requests from the client to the mobile services and from the mobile services to the back end.
- Refreshes the offline store as needed.
- Removes data from the offline store, deletes the offline store and releases resources after the last use of the offline store.
The Offline OData component is your best choice if you have unreliable connectivity or if back-end data is infrequently updated. An example of an offline application is one that is used by field service personnel, who download service information and data from the back end at the beginning of a day, make changes to the offline data throughout the day, then upload modification requests to the back end at the end of the day.
In general, offline scenarios require more thought and planning in terms of performance, data volume and error handling.
An offline application always accesses data that is stored in the offline store, regardless whether the device is connected to the network. It does not automatically sense whether it is connected to the network. You must choose at design time whether the application is online or offline and develop it accordingly. Switching between online and offline modes may result in data loss.
Application developers determine when users can upload and download; for example, automatically, based on a schedule and/or network availability, or you allow the users to upload and download data whenever they choose. You may choose to chain the upload and download together, you may choose to have them be completely independent, or you may choose to have greatly different rates at which those operations are performed. Think through how these decisions will impact your users and back end and be sure to fully test the impact your decisions have on them.
See Offline Applications Overview for information about how offline applications fit into the SAP Cloud Platform landscape.