This is how Trello-like apps support offline data on ever-changing database schemas

Carles Capellas
6 min readAug 7, 2024

Apps that allow users to generate data while being offline (Trello, for example) generally provide a better user experience. They must resolve a challenge however: because the database schema naturally changes as the app evolves, the server must support incoming data generated on an old schema version. How? Here is one way of doing it.

The challenge

At Peek Vision, the company I work for, we collect eye health data from patients in rural areas with little or no connectivity. This means that devices must be able to collect data while being offline. And devices stay offline for surprisingly long periods of time: usually several days, often a couple weeks and sometimes even months.

When devices finally go online they send the data they have collected to the server. Which, like most web APIs, performs validations on it: if the incoming data doesn’t have the expected format it will be rejected. Nothing unusual. But turns out that, as the app evolves and new software is released, the expected formats can change, potentially rendering invalid data collected on offline devices running on a previous software release.

Having hundreds of active users there will hardly be any moments where all devices have synced their data…

--

--

Carles Capellas

Always up for sport, somewhat obsessive about order and, over all things, enthusiastic about coding