Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Data: online and off
Phil Nash
September 21, 2015
Programming
0
130
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
2
130
JavaScript Apps Go Intl - GIDS Live 2021
philnash
1
46
You're on Mute! WebRTC and our Lives on Screen - GIDS Live 2021
philnash
1
48
Better API DX with a CLI - APIdays Jakarta
philnash
0
140
The trouble with webhooks - at Apidays Live Hong Kong
philnash
2
49
Four steps from JavaScript to TypeScript
philnash
0
190
Fantastic passwords and where to find them - at NoRuKo
philnash
27
1.6k
The trouble with webhooks - at APIdays Singapore
philnash
0
93
What's going on with Project Fugu? at DevTalks Reimagined
philnash
0
130
Other Decks in Programming
See All in Programming
Pythonによる開発をアップデートするライブラリの紹介
daikikatsuragawa
1
600
アジャイルで始める データ分析基盤構築
nagano
1
900
FargateとAthenaで作る、機械学習システム
nayuts
0
170
Regular expressions basics/正規表現の基本
kishikawakatsumi
6
260
「困りごと」から始める個人開発
ikumatadokoro
4
250
SRE NEXT 2022に学ぶこれからのSREキャリア
fukubaka0825
2
390
プロダクトの成長とSREと
takuyatezuka
0
120
Introduction to Property-Based Testing @ COSCUP 2022
cybai
1
150
Automating Gradle benchmarks at N26
ubiratansoares
PRO
1
140
Git操作編
smt7174
2
240
Rust on Lambda 大きめCSV生成
atsuyokota
1
390
Better Angular Architectures: Architectures with Standalone Components @DWX2022
manfredsteyer
PRO
1
410
Featured
See All Featured
Music & Morning Musume
bryan
35
4.3k
GraphQLとの向き合い方2022年版
quramy
16
8.4k
Designing for humans not robots
tammielis
241
24k
KATA
mclloyd
7
8.8k
The Invisible Customer
myddelton
110
11k
Learning to Love Humans: Emotional Interface Design
aarron
261
37k
Mobile First: as difficult as doing things right
swwweet
213
7.6k
Happy Clients
brianwarren
89
5.6k
Code Review Best Practice
trishagee
44
9.7k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
39
13k
4 Signs Your Business is Dying
shpigford
169
20k
How STYLIGHT went responsive
nonsquared
85
4k
Transcript
DATA: ONLINE AND OFF
Phil Nash @philnash http:/ /philna.sh philnash@twilio.com
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 philnash@twilio.com 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