Sources Of Truth

Sources Of Truth
Sydney, Australia

I have previously written about the concepts of the division of labour and the supply chain, although what has been said so far has primarily focused on the efforts of third-parties and how they support user-facing applications. These concepts are also relevant on a first-party basis (i.e. systems that the team managing a software application oversee directly) and one of the most obvious ways that plays out in practice is through the reconciliation of multiple sources of truth.

A practical use case of this is in offline-first applications, where software has access to data sources without a hard requirement for internet connectivity. These data sources could be any combination of the operating system itself, files that have been created by the application to maintain saved state over time between sessions, or information that is "hard-coded" (fixed information that is particular to a version) with the installed software. The implication of the term offline-first suggests that it is online-second, meaning that in the event of any conflict there is some kind of reconciliation between the offline state (or truth) and the online state. Depending specifically on what the software is used for, it may be the case that on retrieval of a new online state, that information persists as the new offline state. It may also be defensible for the offline state to not change in response to new online information perhaps for practical reasons such as an unbounded data size and difficulties in communicating clear boundaries, e.g. the reality that not many devices (if any) are capable of storing the entirety of all Google Maps information on their personal mobile phone at one time.

Described above is a situation where one device may have to reconcile two sources of truth to determine what data to simply display, for "read-only" purposes. The situation becomes more complicated if the data in question also needs to be modified. We then have the nominal (baseline) offline state, a modified state, and an online state. Which wins? Which should win is situational. Imagine that we have multiple people (perhaps with no limit on the number) able to modify the same information. We may have one current online state, one nominal offline state, and an infinite number of modified states to reconcile.

Beyond offline-first, in today's production software applications there are other scenarios such as dynamic content updates and A/B testing (perhaps with many more than two cohorts).

Sources of truth don't just play a role in what happens in production, they also play a role at other stages in the software development lifecycle - in automated testing we may disable certain functionality for practical reasons (e.g. to suppress an enable notifications cue when our automated test process does not have the capability to interact with the device prompt), during manual testing there may be certain functionality that does not behave in a manner that is like-for-like when compared to a production environment for reasons related to cost, we may disable certain functionality for particular builds (versions) of software. All of this contributes to a complicated mental model of "what should happen" for developers, quality assurance, and beyond. This is another field where ownership and access rights comes into play - if we need to make a determination as to whether a user needs to have made a purchase, we need to defer to relevant authorities as to whether that has happened. For practical reasons (i.e. the avoidance of spending real currency) there are abstraction layers over the mobile storefronts purchasing mechanisms for the purposes of testing. The testing of 'one-time' purchases in these environments are time-limited, which can be the source of much confusion.

The truth, the whole truth, and nothing but the truth - unpacking it can be much more difficult to navigate than most expect.

Until next time.