Context, problem, and forces

In cloud-native systems, the presentation layer lives on the client and the client device is more and more mobile. Users have more than one device, including phones and tablets and, to a decreasing degree, traditional desktops. The presentation layer must communicate with the backend component to send and receive data and perform actions. Mobile users frequently experience spotty connectivity, which increases latency and often leaves them completely disconnected.

The CAP theorem states that in the presence of a network partition, one has to choose between consistency and availability. In the context of modern consumer facing applications, even a temporary increase in latency is considered to be equivalent to a network partition because of the opportunity cost of lost customers. Therefore, it is widely preferred to choose availability over consistency and thus design systems around eventual consistency and session consistency.

With these realities in mind, we need to architect customer-focused user experiences with an offline-first mindset. At a minimum, some critical features should be reasonably available when the device is disconnected. Crucial information can be cached on the device to enable users to perform and securely store important actions until connectivity is restored. This same information should also synchronize across devices.