Dimagi’s BHOMA project was featured as a case study on couchone today.  In it, we discuss how a technology called CouchDB was used to build the BHOMA system. You can read the full text of the case study below or on couchbase’s website.

Dimagi: A Case Study

BHOMA (Better Health Outcomes through Mentoring and Assessments) is a large research project tasked with improving maternal and child mortality rates in rural Zambia through standardized interventions in clinic care and community health. This requires building a distributed health data capture system, designed and implemented by Dimagi and CIDRZ. This initiative faces many of the same technology challenges encountered in low-resource Africa: limited computer resources, intermittent power, and above all, extremely unreliable internet.

Dimagi needed to leverage the most common modern communications device in many rural communities – the cell phone. But they faced a major hurdle: How to get important and timely patient information from clinics (with no reliable internet connection), to health workers in small communities so they could follow-up with patients in their area. Further, they had to solve how to get information collected on cell phones back to the clinics to monitor patient outcomes.


Dimagi became interested in CouchDB after learning about its replication technology. They needed a fully off-line system for each of their clinics, because the only network connection any of them had was an unreliable GPRS modem on the local cellular network. Network outages and latency could not be allowed to disrupt clinic operations.

By standing up a lightweight server at each clinic, backed by a CouchDB datastore, BHOMA was able to ensure constant uptime in the clinics – providing power was up. Each clinic replicates over the modem’s connection to their national CouchDB database. Because of CouchDB’s continuous replication and optimized synchronization, Dimagi didn’t have to worry about writing complicated sync protocols. Filtered replication allowed them to send only the appropriate data to each clinic, drastically reducing the bandwidth required to sync with the central server. The two-way replication also allowed for data collected on CHWs’ cell phones to propagate back to the clinic, for timely patient updates.


Initially Dimagi envisioned storing only heath records in CouchDB, keeping their Postgres databases for other data. Soon, they realized that the built-in replication of CouchDB enabled access to more information at the clinics. CouchDB solved the toughest logistical problems, freeing them to focus on their application and data, and most importantly the health of rural Zambians.

One of the best things they’ve gotten out of CouchDB is a distributed error logging framework. They integrated their exception handler with CouchDB and now are able to check on the health and errors at all the clinics from a single central server. They can now find problems instantly, where before it could have taken months for someone to visit the clinic and see what was going wrong. This application alone is encouraging them to integrate CouchDB with all of their projects, and if this one project was representative, more and more data will be moving into CouchDB.