Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Offline First - kein Netz, kein Fehler, zufriedene Nutzer (DevDay Dresden 2018)

Offline First - kein Netz, kein Fehler, zufriedene Nutzer (DevDay Dresden 2018)

https://www.devday.de 24.04.2018
Bitte PDF downloaden, um alle Links verwenden zu können.

Sourcecode für Service Worker und PouchDB Demos:

https://github.com/ulid000/offline-first-sw
https://github.com/ulid000/offline-first-sw-server
https://github.com/ulid000/offline-first-pouchdb

"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 einigen Demos für Web-Apps und Native Apps schauen wir uns Lösungen für Caching und Datensynchronisation 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.

Uli Deiters

April 24, 2018
Tweet

More Decks by Uli Deiters

Other Decks in Programming

Transcript

  1. Mit Menschen Software für Menschen entwickeln Ulrich Deiters Software Architect

    @ T-Systems Multimedia Solutions GmbH https://xing.to/ulid Uli @ulid000 #Berlin #Fahrrad …
  2. Offline - das hatten wir doch schon immer! Oh, offline

    geht auch. Prima. Was das geht auch offline? Wow!
  3. Qualitätsattribute ISO 25010: Reliability (Zuverlässigkeit) Maturity (Reife) Availability (Verfügbarkeit) Fault

    Tolerance (Fehlertoleranz) Recoverability (Wiederherstellbarkeit) Performance Efficiency (Effizienz) Security (Sicherheit) … https://www.iso.org/obp/ui/#iso:std:iso-iec:25010:ed-1:v1:en https://www.embarc.de/software-qualitaet-iso-25010/ Resilience
  4. 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.
  5. 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
  6. Service Worker UI Logic REST API Service
 Worker JS Web

    App im Browser vert.x GET /message App Cache Memory Demo https://github.com/ulid000/offline-first-sw-server https://github.com/ulid000/offline-first-sw
  7. 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
  8. Database Synchronisation UI Logic CouchDB
 REST API PouchDB JS Web

    App im Browser CouchDB CouchDB 
 Replication Protocol Indexed DB CouchDB Demo https://github.com/ulid000/offline-first-pouchdb
  9. 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
  10. 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
  11. 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
  12. 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
  13. Was noch? … CouchDB, PouchDB, Couchbase, IBM Cloudant realm.io AWS

    AppSync Google Firebase Offline Data Sync in Azure Mobile Apps Salesforce SmartSync, SmartStore …