Imagine a scenario where the North Korean dictator tweets “Successful missile tests!” and in response POTUS tweets “Sanctions imposed on North Korea”. The timeline of tweets will reveal that sanctions were imposed by the US after North Korea test-fired missiles, but if we flip the order of the tweets, users can comprehend that North Korea test-fired missiles after the US imposed sanctions.
Taking this example a step further, we can see there’s a casual relationship between the two tweets which translate into writes on the backend database. It could potentially happen that the tweet from the North Korean dictator is replicated on a set of servers in Asia while the one from POTUS is replicated on a set of servers in North America. Eventually, the tweets get copied over to all the servers but for a short period of time the regional servers may not have cross-continental tweets. In such a scenario, a user retrieving tweets in Brazil may connect to the North American servers and see the tweet from POTUS first and then see the tweet from North Korea, thinking that North Korea test-fired missiles in retaliation to US sanctions. Because of the lag in replicating tweets globally, the order of the writes is altered or that their causal relationship is inverted.
The consistent prefix reads guarantee says that if a sequence of writes happen in a certain order then the writes are served to the reader in the same order. This is especially important for distributed databases that have different partitions and there’s no global ordering of writes. One mitigation is to direct all the related writes to the same partition. Dependency tracking software is used in situations where writing to the same partition isn’t possible.