Introduction.
This page presents an example design of a Unifinity application (hereafter referred to as "client") that uses an external database server (hereafter referred to as "server").
Design policy when using server data
If data retrieved from the server is to be used by the client, the system should be designed according to the following rules
server
- Prepare API for data acquisition
- Prepare API for updating data
client
- Logic control refers to a database (hereafter referred to as internal DB)
- To read server information, access the server API with "network/GET logic" and write the results to the internal DB
- When updating information on the server, the "network/POST logic" rewrites the data on the server by sending the internal DB data to the API
Edit information retrieved from the server offline
Edit data retrieved from the server in an offline state,
If you want to synchronize data when you are online, design as follows
Internal DB table design
Add columns indicating transmission status to tables that need to be edited when offline.
synchronization processing
The synchronization process is created as follows
- Sends information unsent data to the server
- When an anomaly occurs during data update
- Sets "unsent" to the sent status of the sent record
- When data update is successfully completed
- Sets "Sent" to the sent status of the submitted record
Synchronous timing
- Create a synchronization button and set "Synchronization Processing" as the button's execution process
- Synchronization processing" is always performed when communication occurs due to screen transitions, etc.
Control in case of data conflicts
- Data conflict detection methods and behavior in the event of data conflicts must be agreed upon when designing the server's data update API.