Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

The data sync functionality is handled by Cloudant Sync. Cloudant Sync is a  replication-protocol-compatible datastore for devices that don't want or need to run a full CouchDB instance.  Cloudant replication functionality is used to synchronise data between the local datastore and a remote database, either a CouchDB instance or a Cloudant database. Many datastores can replicate with the same remote database, meaning that cross-device synchronisation is achieved by setting up replications from each device to the remote database.





Setup and Configuration

Dependencies

OpenSRP uses cloudant-sync-datastore-*.jar files setup in the core module lib folder as dependencies and doesn't load the cloudant dependencies through gradle as is norm. This is because the Cloudant sync library code has been modified to include a timestamp field (updated_at) to store the date and time a document is saved in the cloudant database.

After a user submits a form, the form submission is converted to events or clients and saved in the client cloudant database ready for syncing to the server couchdb. To be able to sync data from the client to the server couchdb, the following configurations are required:

PropertyLocationNotes
datastore_manager_directory
This is the directory where cloudant will create the client db file. Set to 'data' by default
datastore_name
The name of the cloudant database name in the client app. Set to 'opensrp_clients_events'
dbURL
port- AllConstants.CloudantSync.COUCHDB_PORTThis is a combination of the server IP address (by default using the IP specified in the settings screen when logging in), server couchdb port number (set to 5984 by default) and the server couch database name
databaseName
AllConstants.CloudantSync.COUCH_DATABASE_NAME

syncFilters




  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.