offline-first: making your app resilient to network failures

39
MAKING YOUR APP RESILIENT TO NETWORK FAILURES OFFLINE-FIRST

Upload: pedro-teixeira

Post on 22-Jan-2018

74 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Offline-first: Making your app resilient to network failures

M A K I N G Y O U R A P P R E S I L I E N T T O N E T W O R K FA I L U R E S

O F F L I N E - F I R S T

Page 2: Offline-first: Making your app resilient to network failures

W H O A M I ?

Page 3: Offline-first: Making your app resilient to network failures
Page 4: Offline-first: Making your app resilient to network failures

M A K I N G Y O U R A P P R E S I L I E N T T O N E T W O R K FA I L U R E S

O F F L I N E - F I R S T

Page 5: Offline-first: Making your app resilient to network failures

M O B I L E W O R L DW E L I V E I N A N I N C R E A S I N G LY

Page 6: Offline-first: Making your app resilient to network failures
Page 7: Offline-first: Making your app resilient to network failures

B E I N G O F F L I N E I S A G I V E N , N O T A N E X C E P T I O N .

Page 8: Offline-first: Making your app resilient to network failures

H O W C A N A P P L I C AT I O N D E V E L O P E R S H A N D L E T H I S ?

Page 9: Offline-first: Making your app resilient to network failures

N O T M Y P R O B L E M

Page 10: Offline-first: Making your app resilient to network failures

N O T I F Y T H E U S E RE R R O R H A N D L I N G

Page 11: Offline-first: Making your app resilient to network failures

H A N D L E I T C A S E B Y C A S E

Page 12: Offline-first: Making your app resilient to network failures
Page 13: Offline-first: Making your app resilient to network failures

O F F L I N E - F I R S T D E V E L O P M E N T

Page 14: Offline-first: Making your app resilient to network failures

S E R V I C E W O R K E R S

“A service worker is a script that your browser runs in the background, separate from a web page, opening the door to features that don't need a web page or user

interaction.”

Page 15: Offline-first: Making your app resilient to network failures

S E R V I C E W O R K E R S

“Using service worker you can hijack connections, fabricate, and filter responses. Powerful stuff.”

https://developers.google.com/web/fundamentals/getting-started/primers/service-workers

Page 16: Offline-first: Making your app resilient to network failures

S E R V I C E W O R K E R S

I’m not here to talk about Service Workers..

Page 17: Offline-first: Making your app resilient to network failures

D ATA S Y N C

I ’ M H E R E T O TA L K A B O U T

Page 18: Offline-first: Making your app resilient to network failures

C O U C H D B

Page 19: Offline-first: Making your app resilient to network failures

F E AT U R E S

• Document database

• Versions

• Changes Feed

• Sync

Page 20: Offline-first: Making your app resilient to network failures
Page 21: Offline-first: Making your app resilient to network failures
Page 22: Offline-first: Making your app resilient to network failures
Page 23: Offline-first: Making your app resilient to network failures
Page 24: Offline-first: Making your app resilient to network failures
Page 25: Offline-first: Making your app resilient to network failures
Page 26: Offline-first: Making your app resilient to network failures
Page 27: Offline-first: Making your app resilient to network failures
Page 28: Offline-first: Making your app resilient to network failures
Page 29: Offline-first: Making your app resilient to network failures
Page 30: Offline-first: Making your app resilient to network failures
Page 31: Offline-first: Making your app resilient to network failures
Page 32: Offline-first: Making your app resilient to network failures
Page 33: Offline-first: Making your app resilient to network failures
Page 34: Offline-first: Making your app resilient to network failures

S O M E O P E N - S O U R C E

• POUCH-CLERK

• https://github.com/pgte/pouch-clerk

• Example app

• https://github.com/pgte/pouch-clerk-example-app

Page 35: Offline-first: Making your app resilient to network failures

D E M O T I M E !

Page 36: Offline-first: Making your app resilient to network failures

TA K E - A W AY S

• Offline is a given, not an exception

• You should not handle networking errors case-by-case

• Embrace offline-first techniques

• Sync is your friend

Page 37: Offline-first: Making your app resilient to network failures

T H A N K Y O U !

O N S L I D E S H A R E :

bit.ly/2pkU4pQ

Page 38: Offline-first: Making your app resilient to network failures

Q U E S T I O N S ?

Page 39: Offline-first: Making your app resilient to network failures

C R E D I T S

• Hans Kylberg - https://www.flickr.com/photos/visulogik/1619008375

• Vodafone UK slide: Jake Archibald, Google I/O

• Machinery: Franz Zajizek, Astronomical Clock Machinery - https://commons.wikimedia.org/wiki/File:Vienna_-_Vintage_Franz_Zajizek_Astronomical_Clock_machinery_-_0518.jpg

• HospitalRun images: @ Cure.org

• Monolith: Expo Murten: https://commons.wikimedia.org/wiki/File:20020719_Expo_Murten_10.JPG