Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Data: online and off
Search
Phil Nash
September 21, 2015
Programming
200
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Data: online and off
Phil Nash
September 21, 2015
Transcript
44 slides
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
More Decks by Phil Nash
See All by Phil Nash
Four steps from JavaScript to TypeScript
philnash
3
640
JavaScript Apps Go Intl - GIDS Live 2021
philnash
2
420
You're on Mute! WebRTC and our Lives on Screen - GIDS Live 2021
philnash
1
420
Better API DX with a CLI - APIdays Jakarta
philnash
0
500
The trouble with webhooks - at Apidays Live Hong Kong
philnash
2
330
Four steps from JavaScript to TypeScript
philnash
0
540
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
The trouble with webhooks - at APIdays Singapore
philnash
0
460
What's going on with Project Fugu? at DevTalks Reimagined
philnash
0
690
Other Decks in Programming
See All in Programming
Scalaの型でマルチテナントの認可を守る
nextbeatdev
0
160
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
360
GraphQL の onError と Nullability のこれから
quramy
0
220
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
16
9.4k
우리의 Nitro Modules는 당신의 Turbo Modules보다 아름답다
l2hyunwoo
0
270
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
210
imagewebp()の向こう側: WebPはなぜ JPEG・PNGより軽いのか
yuzneri
0
130
まずはコードより業務と向き合う:テーブル解体のためにPdMを呼んだ話
sakawe_ee
0
250
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
210
Debian JP Projectのサーバー構成
uwabami
1
130
SODA - FACT BOOK(EN)
sodainc
1
260
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
210
Featured
See All Featured
30 Presentation Tips
portentint
PRO
1
470
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
400
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
520
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
How GitHub (no longer) Works
holman
316
150k
RailsConf 2023
tenderlove
30
1.6k
The SEO identity crisis: Don't let AI make you average
varn
0
630
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Documentation Writing (for coders)
carmenintech
77
5.6k
Embracing the Ebb and Flow
colly
88
5.2k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
How to train your dragon (web standard)
notwaldorf
96
6.9k