Offline and radioactively clean

Choosing CouchDB for designing experiments in remote mountain laboratories logo

Radiopurity for particle physics

In my previous life I was a particle physicist, searching for very rare nuclear reactions (in order to count neutrinos from the sun and search for dark matter). I had forgotten, until very recently, that we too used an Offline First approach to build a database of special materials used to observe these reactions.

For these kinds of experiments, where you see only a few events per day (neutrinos) or zero events over years (dark matter), the name of the game is “background elimination.” This means you must build your experiment out of the least amount of material, and with material that is as radioactively pure as possible.

There is a cottage industry within the particle physics community dedicated to measuring the levels of radioactivity in various materials that are under consideration for use in experiments throughout the world. These measurements often take place in ultra-clean underground laboratories. Until recently, however, there was no central location for these data to be stored.

In this article, I’ll provide some context on the importance of offline first design, and why we chose a database that could support these requirements for our repository of experiment materials.

Offline First

The Watson Data Platform dev advocacy team has been building a great community around the idea of building mobile applications that are offline first. This phrase is meant to encapsulate the mindset of building applications assuming an intermittent network connection to your data, yet not compromising your user’s experience.

The Offline First community meets semi-regularly in various intimate settings at locations around the world, forming their community in small batches of ~30 participants. Their most recent Offline Camp event was held near Berlin. They go remote and literally offline in order to discuss their problems and solutions for building offline-first applications.

The primary data solution for an Offline First architecture has centered around IBM Cloudant. IBM Cloudant, based on Apache CouchDB™, is a database service for managing JSON documents. Cloudant and CouchDB support masterless replication of databases that track revision histories of each document. In addition, there exist mobile libraries that will synchronize a database between device and server. Combined with PouchDB or Cloudant Envoy, this ecosystem becomes a full solution for managing an individual user’s data between the database server and their device.

Choosing Cloudant

My collaborators and I decided that using CouchDB/Cloudant was the best choice for our database of radioactively clean materials. The two primary reasons were the JSON document nature of the database and the easy replication and offline capabilities.

Because measurements for different materials are taken in many different ways with different focus and results, the schema-less nature of JSON document storage was well-suited to record all of the information for each measurement in a single document. It also allowed us to “future-proof” the database to ensure later generations of physicists can add data without having to fit into a schema. We avoided a complicated, normalized relational system that could potentially need to be redesigned to meet future needs.

We chose CouchDB/Cloudant because the software is relatively easy to spin up and because there exist mobile libraries that would allow easy replication of the database to a physicist’s phone, should we ever build a mobile app. The ability to replicate local copies allows researchers to easily carry the database with them to conferences and to test benches in laboratories under the French Alps.

Parting thoughts

If you’re interested in seeing the results, check out, and you’ll find data from a number of radioassay results for different parts and materials that have been compiled from recent rare event research experiments within the particle physics community. There’s also a github repository for this source code, and basic Python modules for interacting with the data. For further reading, we published a paper describing this database last year.

If you enjoyed this article and the search for rare nuclear reactions, please ♡ it to recommend it to other Medium readers.