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
190
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Data: online and off
Phil Nash
September 21, 2015
More Decks by Phil Nash
See All by Phil Nash
Four steps from JavaScript to TypeScript
philnash
3
590
JavaScript Apps Go Intl - GIDS Live 2021
philnash
2
400
You're on Mute! WebRTC and our Lives on Screen - GIDS Live 2021
philnash
1
400
Better API DX with a CLI - APIdays Jakarta
philnash
0
470
The trouble with webhooks - at Apidays Live Hong Kong
philnash
2
310
Four steps from JavaScript to TypeScript
philnash
0
510
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
The trouble with webhooks - at APIdays Singapore
philnash
0
440
What's going on with Project Fugu? at DevTalks Reimagined
philnash
0
650
Other Decks in Programming
See All in Programming
5分で問診!Composer セキュリティ健康診断
codmoninc
0
960
AI時代のPHPer生存戦略 ~「言語、もうなんでもよくない?」に本気で向き合う~
vivion
0
320
その節約、円になってますか?
isamumumu
1
730
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
590
生成AI導入の「期待外れ」を乗り越える ー 開発フロー改革が目指す、真の組織変革
starfish719
0
4.3k
数百円から始めるRuby電子工作
tarosay
0
140
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.9k
今さら聞けない .NET CLI
htkym
0
190
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
490
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
770
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
150
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
530
Featured
See All Featured
A Tale of Four Properties
chriscoyier
163
24k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Design in an AI World
tapps
1
280
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
WCS-LA-2024
lcolladotor
0
790
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Accessibility Awareness
sabderemane
1
170
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
470
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
790
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.8k
How to train your dragon (web standard)
notwaldorf
97
6.7k
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