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
170
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
530
JavaScript Apps Go Intl - GIDS Live 2021
philnash
2
330
You're on Mute! WebRTC and our Lives on Screen - GIDS Live 2021
philnash
1
340
Better API DX with a CLI - APIdays Jakarta
philnash
0
410
The trouble with webhooks - at Apidays Live Hong Kong
philnash
2
250
Four steps from JavaScript to TypeScript
philnash
0
450
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
The trouble with webhooks - at APIdays Singapore
philnash
0
360
What's going on with Project Fugu? at DevTalks Reimagined
philnash
0
560
Other Decks in Programming
See All in Programming
SidekiqでAIに商品説明を生成させてみた
akinko_0915
0
120
ネストしたdata classの面倒な更新にさようなら!Lensを作って理解するArrowのOpticsの世界
shiita0903
1
280
AI POSにおけるLLM Observability基盤の導入 ― サイバーエージェントDXインターン成果報告
hekuchan
0
100
O Que É e Como Funciona o PHP-FPM?
marcelgsantos
0
250
NIKKEI Tech Talk#38
cipepser
0
410
釣り地図SNSにおける有料機能の実装
nokonoko1203
0
210
AI 時代だからこそ抑えたい「価値のある」PHP ユニットテストを書く技術 #phpconfuk / phpcon-fukuoka-2025
shogogg
1
280
AIのバカさ加減に怒る前にやっておくこと
blueeventhorizon
0
160
開発組織の戦略的な役割と 設計スキル向上の効果
masuda220
PRO
10
2.1k
KoogではじめるAIエージェント開発
hiroaki404
1
370
Kotlinで実装するCPU/GPU 「協調的」パフォーマンス管理
matuyuhi
0
300
Private APIの呼び出し方
kishikawakatsumi
0
150
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
80
6k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8k
Automating Front-end Workflow
addyosmani
1371
200k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
2.9k
Become a Pro
speakerdeck
PRO
29
5.6k
Unsuck your backbone
ammeep
671
58k
GraphQLとの向き合い方2022年版
quramy
49
14k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.5k
Embracing the Ebb and Flow
colly
88
4.9k
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