"High Speed Internet, permanently online, permanently connected, LTE überall, na klar geht alles nur online - der Rest ist Error Handling. Done."
Oft ist uns gar nicht mehr bewusst, dass wir damit Nutzer enttäuschen, ihre Zeit verschwenden und die Nutzung unserer Anwendungen einschränken. Leider ist Offline-Fähigkeit nachträglich oft ähnlich schlecht nachrüstbar wie die Unterstützung von Mobile Devices. Daher möchten ich Euch zeigen, wie man mit Offline First von Anfang an "offline denken" kann, vergleichbar mit Mobile First.
Ich werde Euch kurz in die Motivation für Offline-Funktionen, Nutzerwartungen, UX-Ansätze sowie Herausforderungen und Ansätze für die Anwendungsarchitektur und -sicherheit einführen und aufzeigen wie wir CAP und Eventual Consistency auf diese Problemstellung anwenden können.
Anhang von konkreten Kundenprojekten für Native Mobile Apps schauen wir uns Nutzen und Lösungen für effektives Offline-Arbeiten an.
Wir werfen einen Blick darauf, welche Technologien für Progressive Web Apps zur Verfügung stehen und wie Digital Business Platforms wie Salesforce oder die SAP Cloud Platform die Offlinefähigkeit unterstützen. Kann man wirklich schon „Offline as a Service“ dazukaufen?
Also: "Kein Netz" ist nicht zwingend ein Fehler.
30. CAP Theorem (Eric Brewer, 1998)
http://robertgreiner.com/2014/08/cap-theorem-revisited/
https://www.infoq.com/articles/cap-twelve-years-later-how-the-rules-have-changed https://martin.kleppmann.com/2015/05/11/please-stop-calling-databases-cp-or-ap.html
http://abiasforaction.net/cap-theorem/
Linearizable Consistency Availability
Network Partition Tolerance
In the case of a network Partition choose one:
Linearizable Consistency vs. Availability
context: read/write operations
31. Eventual Consistency (Werner Vogels, 2008)
https://dl.acm.org/citation.cfm?doid=1466443.1466448
https://www.allthingsdistributed.com/2008/12/eventually_consistent.html
Wenn keine weiteren
Schreibvorgänge stattfinden
und keine Netzwerkfehler existieren,
werden die Daten schließlich
über alle Knoten konsistent.
33. Service Worker
PWA
„A service worker is a
programmable network proxy
that lets you control how
network requests from your
page are handled.“
Fetch is the new XHR
Lifecycle
Offline Cookbook
Google Workbox
https://jakearchibald.com/2014/offline-cookbook/
https://developers.google.com/web/tools/workbox/ Portions of this page are reproduced from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.
Stale While Revalidate
35. Database Synchronisation
PouchDB
=> Browser/node
(JavaScript)
Apache CouchDB
=> Server (Erlang)
Multiversion Concurrency
Control (MVCC)
Replication Protocol
Conflict Resolution
Image from https://github.com/oreilly/couchdb-guide available under a Creative Commons Attribution license
37. Google Android Architecture Components
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
https://developer.android.com/topic/libraries/architecture/guide.html
38. Google Android Architecture Components - NetworkBoundResource
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
https://developer.android.com/topic/libraries/architecture/guide.html
39. Architecture Components Sample App
Activity/
Fragment
ViewModel
GitHub
REST API
Repository
Android App GitHub
HTTP GET …
SQLite
Demo
https://github.com/googlesamples/android-architecture-components/tree/master/GithubBrowserSample
Model
Remote
Data
Source
Room
41. User Experience
Freshness
Reach
Assurance
• Zeitstempel der letzten Änderung der Daten
• Zeitstempel der letzten Synchronisation
• Erreichbar
• Nicht erreichbar
• Unbekannt
• Gespeichert
• Synchronisiert
• Speicherung/Synchronisation fehlgeschlagen
• Unbekannt
https://medium.com/@jessebeach/my-biggest-takeaway-from-the-second-offline-camp-in-santa-margarita-ca-d0dd930cd02b
Expressing offline syncing to the end user
42. Was noch?
…
CouchDB, PouchDB, Couchbase, IBM Cloudant
realm.io
AWS AppSync
Google Firebase
Offline Data Sync in Azure Mobile Apps
Salesforce SmartSync, SmartStore
…