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
160
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
450
JavaScript Apps Go Intl - GIDS Live 2021
philnash
2
290
You're on Mute! WebRTC and our Lives on Screen - GIDS Live 2021
philnash
1
300
Better API DX with a CLI - APIdays Jakarta
philnash
0
360
The trouble with webhooks - at Apidays Live Hong Kong
philnash
2
210
Four steps from JavaScript to TypeScript
philnash
0
410
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
The trouble with webhooks - at APIdays Singapore
philnash
0
310
What's going on with Project Fugu? at DevTalks Reimagined
philnash
0
490
Other Decks in Programming
See All in Programming
Bedrock Agentsレスポンス解析によるAgentのOps
licux
3
910
Multi Step Form, Decentralized Autonomous Organization
pumpkiinbell
1
860
Kotlinの開発でも AIをいい感じに使いたい / Making the Most of AI in Kotlin Development
kohii00
5
980
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
190
Honoをフロントエンドで使う 3つのやり方
yusukebe
7
3.5k
Django NinjaによるAPI開発の効率化とリプレースの実践
kashewnuts
1
250
パスキーのすべて ── 導入・UX設計・実装の紹介 / 20250213 パスキー開発者の集い
kuralab
3
880
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
120
責務と認知負荷を整える! 抽象レベルを意識した関心の分離
yahiru
8
1.3k
pylint custom ruleで始めるレビュー自動化
shogoujiie
0
150
Datadog Workflow Automation で圧倒的価値提供
showwin
1
150
PEPCは何を変えようとしていたのか
ken7253
2
160
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
521
39k
The Language of Interfaces
destraynor
156
24k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
GitHub's CSS Performance
jonrohan
1030
460k
YesSQL, Process and Tooling at Scale
rocio
172
14k
How to Ace a Technical Interview
jacobian
276
23k
4 Signs Your Business is Dying
shpigford
182
22k
Git: the NoSQL Database
bkeepers
PRO
427
65k
Bash Introduction
62gerente
611
210k
Designing Experiences People Love
moore
140
23k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
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