Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Data: online and off
Search
Phil Nash
September 21, 2015
Programming
0
160
Data: online and off
Phil Nash
September 21, 2015
Tweet
Share
More Decks by Phil Nash
See All by Phil Nash
Four steps from JavaScript to TypeScript
philnash
3
500
JavaScript Apps Go Intl - GIDS Live 2021
philnash
2
310
You're on Mute! WebRTC and our Lives on Screen - GIDS Live 2021
philnash
1
320
Better API DX with a CLI - APIdays Jakarta
philnash
0
390
The trouble with webhooks - at Apidays Live Hong Kong
philnash
2
230
Four steps from JavaScript to TypeScript
philnash
0
440
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
The trouble with webhooks - at APIdays Singapore
philnash
0
330
What's going on with Project Fugu? at DevTalks Reimagined
philnash
0
530
Other Decks in Programming
See All in Programming
從零到一:搭建你的第一個 Observability 平台
blueswen
1
880
カクヨムAndroidアプリのリブート
numeroanddev
0
410
インターフェース設計のコツとツボ
togishima
2
700
Enterprise Web App. Development (2): Version Control Tool Training Ver. 5.1
knakagawa
1
110
無関心の谷
kanayannet
0
160
Perlで痩せる
yuukis
1
680
The Evolution of Enterprise Java with Jakarta EE 11 and Beyond
ivargrimstad
1
620
KotlinConf 2025 現地で感じたServer-Side Kotlin
n_takehata
1
200
UPDATEがシステムを複雑にする? イミュータブルデータモデルのすすめ
shimomura
1
530
DroidKnights 2025 - 다양한 스크롤 뷰에서의 영상 재생
gaeun5744
2
130
Spring gRPC で始める gRPC 入門 / Introduction to gRPC with Spring gRPC
mackey0225
2
490
Create a website using Spatial Web
akkeylab
0
260
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
299
21k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
6
690
Done Done
chrislema
184
16k
Gamification - CAS2011
davidbonilla
81
5.3k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Scaling GitHub
holman
459
140k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
How to Ace a Technical Interview
jacobian
276
23k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
900
How GitHub (no longer) Works
holman
314
140k
Transcript
DATA: ONLINE AND OFF
Phil Nash @philnash http:/ /philna.sh
[email protected]
DATA: ONLINE AND OFF
OFFLINE FIRST
Offline first An application that treats the network as an
enhancement
Not offline first • Graceful failure to network requests •
Just saving data client side
None
None
THINGS TO CONSIDER
ASSETS
SERVICE WORKER
None
USER DATA
None
DATA: ONLINE AND OFF
Data: online and off • Traditional application data storage •
Traditional vs offline first • Browser based data storage • Offline first and data
TRADITIONAL APPLICATION DATA STORAGE
GET / POST
Traditional application data storage 1. POST data to a server
2. Server stores data in a database 1. GET request for data 2. Server interprets request and delivers
OFFLINE?
TRADITIONAL VS OFFLINE FIRST
INTERACT LOCALLY
Interact locally • Save data locally • Retrieve data from
local cache
Interact locally • Crazy fast! • The network doesn't matter
THEN SYNC
Sync • People have multiple devices • Good as a
backup
Sync • Can be asychronous • Can be intentional •
Requires network
DATA STORAGE IN THE FRONT END
LOCALSTORAGE
LocalStorage • Simple key value store • Synchronous (slow)
WEBSQL
WEBSQL
INDEXEDDB
IndexedDB • Asynchronous • o_O
MAKING DATA OFFLINE FIRST
Making data offline first We need something that is: •
Easily distributed • Eventually consistent • Resolves conflicts • Web friendly
None
CouchDB Apache CouchDB™ is a database that uses JSON for
documents, JavaScript for MapReduce indexes, and regular HTTP for its API
None
PouchDB • CouchDB for the browser/Node • Wraps IndexedDB or
WebSQL • LocalStorage adapter available as a plugin
DEMO
Offline first • The time for offline first is now
• Distributing data like this requires a change of mindset • Not all application data needs to be stored this way
Help me! On a scale of 0 to 10, how
likely is it that you would recommend this talk to a friend or colleague? 0203 322 5761
Thanks! @philnash http:/ /philna.sh
[email protected]
On a scale of 0
to 10, how likely is it that you would recommend this talk to a friend or colleague? 0203 322 5761