Skip to content

Technical Design details

satyan edited this page Sep 25, 2014 · 4 revisions

Offline Availability Design:

In areas of low connectivity, data is required to be made offline for the officers to perform the required operations. Following are some of the operations required:

  1. Ability to download from server and store data offline.
  2. Ability to add, update and modify existing data.
  3. Sync/Push the modified data back to server when connectivity restores.
  4. Secure data at rest (stored on file system).

Solution:

There are 3 parts to the solution.

  1. Choosing an offline storage mechanism.
  2. Strategy to push data to the server, and handle error scenarios.
  3. Secure data at rest.

Offline Storage:

SQLite database. It is a built-in storage mechanism provided by android sdk. Sugar ORM to be used as an abstraction to help in persistence and manipulation of the stored data. Sugar ORM takes care of creation/upgrade of the database, also it has wrappers for easy querying and manipulation of the data.

Sync process:

Data is downloaded and pushed back to the server on demand. User downloads the data and syncs it back to server when connectivity is restored. While offline, user can add/modify the data. Every record maintains a changed flag, and a sync flag. On a successful backend sync, sync flag is set to indicate that. This prevents duplicate submission of data.

Security:

SQLCipher is used to encrypt the sqlite database. This prevents anyone from extracting the sqlite database file and reading into it.

Demo Credentials

  1. Username: mifos
  2. Password: password
Clone this wiki locally