The Offline Native Mobile applications architecture has to consider two situations where these apps should work:
- When the application is disconnected.
- When the application has a connection.
In the first case, the app has to be able to process data and interact with a database without a network connection.
In the second scenario, the app can synchronize data with the server by invoking web services.
Connected or not, all the processing of the application is done on the device, updating the local database. Once the connection is restored, synchronization will be executed.
An Offline Native Mobile application can be split into two components: a local component and a server component.
The server may have a backend for the application, the database, and a services layer for data synchronization with the devices.
On the devices, the applications also have a database with a subset of the server data and all the logic that needs to be executed locally. That logic is written in the native code of the device (Objective-c/Swift for Apple, Java for Android, etc.). The application also has all the metadata required for the UI layout and user events.
Both components (device and server) communicate via REST services to perform the required synchronization to fill the local database and to send the modifications performed on the device to the server.
The communication between the Native Mobile application and the server is known as synchronization.
Read the Advanced Concepts of Offline Applications architecture document to learn more about the Offline applications architecture.