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
550
JavaScript Apps Go Intl - GIDS Live 2021
philnash
2
350
You're on Mute! WebRTC and our Lives on Screen - GIDS Live 2021
philnash
1
360
Better API DX with a CLI - APIdays Jakarta
philnash
0
430
The trouble with webhooks - at Apidays Live Hong Kong
philnash
2
270
Four steps from JavaScript to TypeScript
philnash
0
470
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
The trouble with webhooks - at APIdays Singapore
philnash
0
390
What's going on with Project Fugu? at DevTalks Reimagined
philnash
0
610
Other Decks in Programming
See All in Programming
Claude Code、ちょっとした工夫で開発体験が変わる
tigertora7571
0
190
あなたはユーザーではない #PdENight
kajitack
4
290
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
Rails Girls Tokyo 18th GMO Pepabo Sponsor Talk
yutokyokutyo
0
190
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
660
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
12
7.3k
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
200
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
220
DSPy入門 Pythonで実現する自動プロンプト最適化 〜人手によるプロンプト調整からの卒業〜
seaturt1e
1
450
15年目のiOSアプリを1から作り直す技術
teakun
0
580
PJのドキュメントを全部Git管理にしたら、一番喜んだのはAIだった
nanaism
0
230
ぼくの開発環境2026
yuzneri
1
290
Featured
See All Featured
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
370
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
65
Deep Space Network (abreviated)
tonyrice
0
84
New Earth Scene 8
popppiees
1
1.7k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
760
GraphQLの誤解/rethinking-graphql
sonatard
75
11k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
290
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
130
Automating Front-end Workflow
addyosmani
1370
200k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
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